diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2014-12-26 14:44:07 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2014-12-26 14:44:07 +0000 |
| commit | c784e87f3b53e823dfb303e296ede834accc9322 (patch) | |
| tree | d66e298e132dc90693a8e5232a88e02c27edf655 /src/style.cpp | |
| parent | Remove sp_style_new(). (diff) | |
| download | inkscape-c784e87f3b53e823dfb303e296ede834accc9322.tar.gz inkscape-c784e87f3b53e823dfb303e296ede834accc9322.zip | |
SPStyle ref counting clean up.
(bzr r13822.1.7)
Diffstat (limited to 'src/style.cpp')
| -rw-r--r-- | src/style.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |
