On 22/11/2013 19:17, Kjell Ahlstedt
wrote:
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 agree (read on...) 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 |