summaryrefslogtreecommitdiffstats
path: root/src/display/drawing-item.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-12-26 14:44:07 +0000
committertavmjong-free <tavmjong@free.fr>2014-12-26 14:44:07 +0000
commitc784e87f3b53e823dfb303e296ede834accc9322 (patch)
treed66e298e132dc90693a8e5232a88e02c27edf655 /src/display/drawing-item.cpp
parentRemove sp_style_new(). (diff)
downloadinkscape-c784e87f3b53e823dfb303e296ede834accc9322.tar.gz
inkscape-c784e87f3b53e823dfb303e296ede834accc9322.zip
SPStyle ref counting clean up.
(bzr r13822.1.7)
Diffstat (limited to 'src/display/drawing-item.cpp')
-rw-r--r--src/display/drawing-item.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp
index 83d4744c9..89ca66dc4 100644
--- a/src/display/drawing-item.cpp
+++ b/src/display/drawing-item.cpp
@@ -366,10 +366,12 @@ DrawingItem::setStyle(SPStyle *style, SPStyle *context_style)
// std::cout << "DrawingItem::setStyle: " << name() << " " << style
// << " " << context_style << std::endl;
- if (style) sp_style_ref(style);
- if (_style) sp_style_unref(_style);
- _style = style;
-
+ if( style != _style ) {
+ if (style) sp_style_ref(style);
+ if (_style) sp_style_unref(_style);
+ _style = style;
+ }
+
if (style && style->filter.set && style->getFilter()) {
if (!_filter) {
int primitives = sp_filter_primitive_count(SP_FILTER(style->getFilter()));