From: buliabyak Date: Sat, 20 Sep 2008 23:58:20 +0000 (+0000) Subject: properly detach SPObject from repr when deleting clone X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fdde98ebc36d9a07a021cf1b7d1b90ebbd6dbe6e;p=inkscape.git properly detach SPObject from repr when deleting clone --- diff --git a/src/sp-use.cpp b/src/sp-use.cpp index 213f827ef..8b6321745 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -139,6 +139,12 @@ sp_use_finalize(GObject *obj) { SPUse *use = (SPUse *) obj; + if (use->child) { + sp_object_detach(SP_OBJECT(obj), use->child); + use->child = NULL; + } + + use->ref->detach(); delete use->ref; use->_delete_connection.~connection(); @@ -170,7 +176,10 @@ sp_use_release(SPObject *object) { SPUse *use = SP_USE(object); - use->child = NULL; + if (use->child) { + sp_object_detach(object, use->child); + use->child = NULL; + } use->_delete_connection.disconnect(); use->_changed_connection.disconnect();