From fdde98ebc36d9a07a021cf1b7d1b90ebbd6dbe6e Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sat, 20 Sep 2008 23:58:20 +0000 Subject: [PATCH] properly detach SPObject from repr when deleting clone --- src/sp-use.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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(); -- 2.30.2