Re: Gtk::Widget::on_hide
- From: Kjell Ahlstedt <kjell ahlstedt bredband net>
 
- To: John Emmas <johne53 tiscali co uk>
 
- Cc: gtkmm-list gnome org
 
- Subject: Re: Gtk::Widget::on_hide
 
- Date: Thu, 21 Nov 2013 10:17:52 +0100
 
On 19/11/2013 15:48, Kjell Ahlstedt wrote:
You mentioned in 
https://mail.gnome.org/archives/gtkmm-list/2013-November/msg00022.html that 
you have "glibmm_Glib::quark_" in the list of GQuarks, when I have 
"glibmm_Glib::quark_cpp_wrapper_deleted_". It's as if
    g_object_steal_qdata((GObject*)gobj(), Glib::quark_);
    g_object_set_qdata((GObject*)gobj(), 
Glib::quark_cpp_wrapper_deleted_, (gpointer)true);
in Gtk::Object::disconnect_cpp_wrapper() don't do what they should. 
Confusing!
What's confusing to me is that your code ever reaches those two 
lines!  When I close my test window (MyDialog), the function 
Object::destroy_notify_() invariably gets called before 
Object::disconnect_cpp_wrapper().  Since Object::destroy_notify_() 
sets 'gobject_' to NULL, I don't see how those lines can ever get 
reached...  ???  Should it be setting 'gobject_ to NULL or is there a 
bit of the patch missing?
Apart from that little quirk it's all much more solid today than it 
was yesterday.
John
You are right. I have tested with gtkmm 3, where the patches in bug 
605728 have been applied. Then Gtk::Object::destroy_notify_() is called 
before Gtk::Object::disconnect_cpp_wrapper(), and the *_qdata() 
functions are not called.
But with gtkmm 2.24.4 without those patches, 
Gtk::Object::disconnect_cpp_wrapper() is called first. It removes 
Glib::quark_, and therefore Gtk::Object::destroy_notify_() is not called 
when the underlying GDialog object is finalized. (Without Glib::quark_, 
Glib::ObjectBase::destroy_notify_callback_() is not called.)
The most puzzling thing is why you are (as far as I know) the only one 
who have reported crashes with even the shortest possible gtkmm 
applications. Your problems are so severe that I would expect complaints 
from most affected users of gtkmm.
Getting back to 
https://mail.gnome.org/archives/gtkmm-list/2013-November/msg00043.html, 
you say there, before you applied any patches, that gobject_ is set to 0 
in Gtk::Object::disconnect_cpp_wrapper(), and then 
Gtk::Widget::on_unrealize() is called, and the program crashes there, 
because gobject_ == 0. But when disconnect_cpp_wrapper() sets gobject_ = 
0, it also removes Glib::quark_ with 
g_object_steal_qdata((GObject*)gobj(), Glib::quark_). If that's done, 
on_unrealize() won't be called. See also 
https://mail.gnome.org/archives/gtkmm-list/2013-November/msg00045.html.
Kjell
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]