Re: when we can delete a class derived from Gtk::Window or others



Hi Klaus,
On 19/2/22 13:00, Klaus <zfrdh web de> wrote:
I tested you example and it works whenever the user closes the windows in the reverse
order from creation.
That it seems to work is known. The question is, is it the allowed way
to do this? If the Gtk::Window class performs more actions after hide()
and access data for the current class, the code has undefined behavior,
even if it works in the moment. I simply could not find any
documentation which gives me an idea what the window class perform on
close action.

BTW: Overriding the unrealize() function compiles ( override gives no
error message from the compiler ) but the function will never be called.
Nice bug! The signal handler manually connected via connect() works. Wow :-)

But, what happens if the user closes the parent window first?
All the given example is only a stupid example to give an idea what I
need to do. That in case of unordered closes something may hang is not
the problem. The question to answer is only for the current window and
delete. All interactions in the example code are not in focus here.
I was going to suggest you something like this:
https://www.gnuinos.org/gtkmm/simple.cc
Hope this helps :)
Aitor.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]