On 22/11/2013 19:17, Kjell Ahlstedt wrote:
2013-11-22 18:45, John Emmas skrev:
This crashes:-
Gtk::SpinButton some_spin_button;
Gtk::Adjustment some_adjuster (2, 0, 100, 1, 10, 0);
some_spin_button.set_adjustment (some_adjuster);
That's what I have now once again tested with 2.24.4 without extra
patches. No crash!
Hi Kjell,
Please don't take that as an indication that the problem must be at my
end. The crash is caused by some memory getting deleted and later
re-accessed. When MSVC deletes some memory it sets the memory pointer
to some junk value (typically 0xfeeefeee). This causes a crash if you
carry on using the pointer or if you try to free the memory twice. GCC
doesn't do this AFAIK. It will quite happily let you delete memory but
then carry on using the pointer (not safely of course but often, it can
work). It will NEVER work for an MSVC build.
I once again get the suspicion that g_object_steal_qdata() does not
work correctly for you.
I agree (read on...)
I've used gdb, and set breakpoints at
Gtk::Object::disconnect_cpp_wrapper() and
Glib::ObjectBase::destroy_notify_callback_().
Here's the result:
Could you try setting a third breakpoint in Object::destroy_notify_() ?
Here's the reason I'm asking....
In my current code (which now includes the two patches)
'Object::destroy_notify_()' invariably gets called BEFORE any call to
'Object::disconnect_cpp_wrapper()'. The net effect is that these two
function calls now NEVER get reached:-
g_object_steal_qdata((Gobject*)gobj(), Glib::quark_));
g_object_set_qdata((Gobject*)gobj(), Glib::quark_cpp_wrapper_deleted_,
(gpointer)true));
These are the calls you're suspicious about. Clearly, they're still
getting reached on your system though it would be interesting to know if
that's still true after you apply the patches. My suspicion is either:-
a) On your system, 'disconnect_cpp_wrapper()' gets called before
'destroy_notify_()' (the opposite way to me).
b) The call order is the same - but there's something different
about the functions.
Another possibility is that there's a bit more to the patch (an extra
bit that I haven't got yet?) I only applied the two patches mentioned
in Comment #25:-
https://bugzilla.gnome.org/show_bug.cgi?id=605728#c25
It would be very interesting if you could apply those patches and see if
they change the calling order for you (like they did for me).
John
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list