--- libgnomecanvas-2.3.0/libgnomecanvas/gnome-canvas.c	Thu Mar 27 12:35:21 2003
+++ libgnomecanvas/libgnomecanvas/gnome-canvas.c	Mon Apr  7 12:41:15 2003
@@ -316,26 +316,27 @@
 
 	item = GNOME_CANVAS_ITEM (object);
 
-	redraw_if_visible (item);
+	if (item->canvas)
+		redraw_if_visible (item);
 
 	/* Make the canvas forget about us */
 
-	if (item == item->canvas->current_item) {
+	if (item->canvas && item == item->canvas->current_item) {
 		item->canvas->current_item = NULL;
 		item->canvas->need_repick = TRUE;
 	}
 
-	if (item == item->canvas->new_current_item) {
+	if (item->canvas && item == item->canvas->new_current_item) {
 		item->canvas->new_current_item = NULL;
 		item->canvas->need_repick = TRUE;
 	}
 
-	if (item == item->canvas->grabbed_item) {
+	if (item->canvas && item == item->canvas->grabbed_item) {
 		item->canvas->grabbed_item = NULL;
 		gdk_pointer_ungrab (GDK_CURRENT_TIME);
 	}
 
-	if (item == item->canvas->focused_item)
+	if (item->canvas && item == item->canvas->focused_item)
 		item->canvas->focused_item = NULL;
 
 	/* Normal destroy stuff */
@@ -349,6 +350,8 @@
 	if (item->parent)
 		group_remove (GNOME_CANVAS_GROUP (item->parent), item);
 
+	item->canvas = NULL;
+
 	g_free (item->xform);
 	item->xform = NULL;
 
@@ -1536,6 +1539,7 @@
 		child = list->data;
 		list = list->next;
 
+		// child is unref'ed by the child's group_remove().
 		gtk_object_destroy (GTK_OBJECT (child));
 	}
 
@@ -2188,6 +2192,7 @@
 		canvas->root_destroy_id = 0;
 	}
 	if (canvas->root) {
+		gtk_object_destroy (GTK_OBJECT (canvas->root));
 		g_object_unref (G_OBJECT (canvas->root));
 		canvas->root = NULL;
 	}
