From c784e87f3b53e823dfb303e296ede834accc9322 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 26 Dec 2014 15:44:07 +0100 Subject: SPStyle ref counting clean up. (bzr r13822.1.7) --- src/style.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index 1d08db4f8..0772a4bce 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -458,6 +458,10 @@ SPStyle::~SPStyle() { _properties.clear(); + // Conjecture: all this SPStyle ref counting is not needed. SPObject creates an instance of + // SPStyle when it is constructed and deletes it when it is destructed. The refcount is + // incremented and decremented only in the files: display/drawing-item.cpp, + // display/nr-filter-primitive.cpp, and libnrtype/Layout-TNG-Input.cpp. if( _refcount > 1 ) { std::cerr << "SPStyle::~SPStyle: ref count greater than 1! " << _refcount << std::endl; } @@ -1237,7 +1241,7 @@ sp_style_ref(SPStyle *style) { g_return_val_if_fail(style != NULL, NULL); - style->ref(); // Increase ref count + style->style_ref(); // Increase ref count return style; } @@ -1250,7 +1254,7 @@ SPStyle * sp_style_unref(SPStyle *style) { g_return_val_if_fail(style != NULL, NULL); - if (style->unref() < 1) { + if (style->style_unref() < 1) { delete style; return NULL; } -- cgit v1.2.3