From ec988e4e64be7b5c5de708799bb93e818a15f8d4 Mon Sep 17 00:00:00 2001 From: mental Date: Sun, 12 Mar 2006 00:23:40 +0000 Subject: [PATCH] experiment with moving release beofre extraction of object from document tree --- ChangeLog | 7 +++++++ src/sp-object.cpp | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d34c6cccb..f4685db88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,16 @@ +2006-03-11 MenTaLguY + + * src/sp-object.cpp: experiment to verify that we can safely release + before removing object from document tree + 2006-03-10 Jon A. Cruz + * src/dialogs/swatches.cpp: Changed color dragging to have a color preview. 2006-03-09 Jon A. Cruz + * src/interface.cpp: Initial cut of color drag-n-drop to items on canvas. diff --git a/src/sp-object.cpp b/src/sp-object.cpp index fd368dd61..5f6bf779f 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -659,6 +659,8 @@ sp_object_detach(SPObject *parent, SPObject *object) { g_return_if_fail(SP_IS_OBJECT(object)); g_return_if_fail(object->parent == parent); + sp_object_invoke_release(object); + SPObject *prev=NULL; for ( SPObject *child = parent->children ; child && child != object ; child = child->next ) @@ -679,7 +681,6 @@ sp_object_detach(SPObject *parent, SPObject *object) { object->next = NULL; object->parent = NULL; - sp_object_invoke_release(object); parent->_updateTotalHRefCount(-object->_total_hrefcount); sp_object_unref(object, parent); } @@ -870,9 +871,6 @@ sp_object_invoke_release(SPObject *object) g_assert(object != NULL); g_assert(SP_IS_OBJECT(object)); - // we need to remember our parent - // g_assert(!object->parent); - g_assert(!object->next); g_assert(object->document); g_assert(object->repr); -- 2.30.2