GNOME Bugzilla – Bug 99689
Crashes when the canvas is destroyed before canvas items can be destroyed
Last modified: 2005-05-19 13:42:27 UTC
CanvasItems crash when they are disposed after the canvas itself is disposed. This behaviour has been observed when using the canvas through gnome-python (the python objects might hold a reference on the canvas item). Analysis -------- A canvas item holds a reference to its canvas. However, if the canvas is disposed and some other object holds a reference to the canvas item, the canvas item holds a reference to a invalid memory location. Solution -------- g_object_add_weak_pointer() should be used to set the canvas to NULL as soon as it is destroyed.
Created attachment 15524 [details] [review] Adds weak references to GnomeCanvasItem::parent and ::canvas
I found out that GnomeCanvasGroup uses gtk_object_destroy() to destroy the canvas items. It makes no sense to hold weak references while stuff is destroyed... GnomeCanvas however, uses g_object_unref... This is IMHO not correct. See also bug #90259
Adding keywords and upping pri. Please review.
Please take a look at the patch in this report.
using weak pointers is overkill. the bug is will be fixed by applying the patch from bug #90259.
The patch mentioned above has been commited. Closing this.