Re: Where to free dynamic allocated widgets, generated within signal handlers

Klaus Rudolph <[email protected]>
Newsgroups gmane.comp.gnome.gtkmm
Message-ID <[email protected]>
Hi Daniel,

>
> anyway, if you need to, if you new a window somewhere, then you can
> connect to its ::delete-event and delete there via a captured pointer,
> being sure to return true so GTK does not then try to do anything with
> the dead win.

OK, but no need to capture it as it is "this" in that case or I am wrong?



>
> free(this) is so wildly wrong.

Yeahhhh!!! :-) Don't programmed in C for many years. No idea why I put
that to the sample as a comment...

> delete(this) would also be wrong: in the dtor because it would
> cause an infinite loop...

But it is not the dtor, it is in the sig handler for the delete event.
Is that the safe way?

Regards
  Klaus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.