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

Klaus <[email protected]>
Newsgroups gmane.comp.gnome.gtkmm
Message-ID <[email protected]>
Am 04.01.20 um 11:55 schrieb Kjell Ahlstedt:
> I think
> https://gitlab.gnome.org/GNOME/gtkmm-documentation/blob/gtkmm-3-24/examples/book/application/command_line_handling/exampleapplication.cc
> contains a solution to your problem. See
> ExampleApplication::create_window() and
> ExampleApplication::on_window_hide().
>
Thanks Kjell!

What I see is, that the hide signal is delegated to some "other"
instance which calls the delete.


window->signal_hide().connect(sigc::bind<Gtk::Window*>(sigc::mem_fun(*this,
     &ExampleApplication::on_window_hide), window));

  void ExampleApplication::on_window_hide(Gtk::Window* window) {
delete window; }

My question still is: Is it safe to delete the "own" window the the
"own" signal handler and which signal handler is best to use for the
call to delete. Is it either on_hide() or on_delete_event( GdkEventAny* );

Thanks!
  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.