Code

experiment with moving release beofre extraction of object from document tree
authormental <mental@users.sourceforge.net>
Sun, 12 Mar 2006 00:23:40 +0000 (00:23 +0000)
committermental <mental@users.sourceforge.net>
Sun, 12 Mar 2006 00:23:40 +0000 (00:23 +0000)
ChangeLog
src/sp-object.cpp

index d34c6cccbec9b8a11bceaa67b5c589e5be4c1cb0..f4685db88750d04cbed4eab0b60c6f70decf935c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,16 @@
+2006-03-11  MenTaLguY  <mental@rydia.net>
+
+       * src/sp-object.cpp: experiment to verify that we can safely release
+         before removing object from document tree
+
 2006-03-10  Jon A. Cruz  <jon@joncruz.org>
+
        * src/dialogs/swatches.cpp:
 
          Changed color dragging to have a color preview.
        
 2006-03-09  Jon A. Cruz  <jon@joncruz.org>
+
        * src/interface.cpp:
 
          Initial cut of color drag-n-drop to items on canvas.
index fd368dd613a0164915c70f0797dec0bb09f10f08..5f6bf779fabc2d90c011ce32469ee5ddf736a517 100644 (file)
@@ -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);