summaryrefslogtreecommitdiffstats
path: root/src/style.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-02-06 01:56:17 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-02-06 01:56:17 +0000
commite6578ce0f6538fa3d0dcb67a0e18a82c9029d7e6 (patch)
treec65ddda33627706e5c4c993556d508a501b799c5 /src/style.cpp
parentStupid bug in generate-constraints events comparison test fixed (diff)
downloadinkscape-e6578ce0f6538fa3d0dcb67a0e18a82c9029d7e6.tar.gz
inkscape-e6578ce0f6538fa3d0dcb67a0e18a82c9029d7e6.zip
yet another fix along the same lines: disconnect listeners if they have been connected, checking a flag instead of relying on style->object
(bzr r85)
Diffstat (limited to 'src/style.cpp')
-rw-r--r--src/style.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/style.cpp b/src/style.cpp
index 9dd950361..e0a1dcc7d 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -390,6 +390,7 @@ sp_style_new()
style->cloned = false;
style->hreffed = false;
+ style->listening = false;
return style;
}
@@ -2009,6 +2010,7 @@ sp_style_merge_ipaint(SPStyle *style, SPIPaint *paint, SPIPaint const *parent)
G_CALLBACK(sp_style_paint_server_release), style);
g_signal_connect(G_OBJECT(paint->value.paint.server), "modified",
G_CALLBACK(sp_style_paint_server_modified), style);
+ style->listening = true;
}
}
break;
@@ -2863,6 +2865,7 @@ sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocume
G_CALLBACK(sp_style_paint_server_release), style);
g_signal_connect(G_OBJECT(paint->value.paint.server), "modified",
G_CALLBACK(sp_style_paint_server_modified), style);
+ style->listening = true;
}
} else {
paint->value.paint.server = NULL;
@@ -3401,10 +3404,12 @@ sp_style_paint_clear(SPStyle *style, SPIPaint *paint,
if (hunref && (paint->type == SP_PAINT_TYPE_PAINTSERVER) && paint->value.paint.server) {
if (style->hreffed) {
sp_object_hunref(SP_OBJECT(paint->value.paint.server), style);
+ style->hreffed = false;
}
- if (style->object || style->cloned) {
+ if (style->listening) {
g_signal_handlers_disconnect_matched(G_OBJECT(paint->value.paint.server),
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, style);
+ style->listening = false;
}
paint->value.paint.server = NULL;
paint->value.paint.uri = NULL;