summaryrefslogtreecommitdiffstats
path: root/src/xml/helper-observer.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2014-06-16 18:26:07 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2014-06-16 18:26:07 +0000
commitbf23e1b45a6ed8990ca3401064840159eeeb47cb (patch)
tree19bdfc28ad0db01f9021b114a6b9e57f0a4b3619 /src/xml/helper-observer.cpp
parentadd proper refcounting to XML SignalObserver. not refcounting caused crash up... (diff)
downloadinkscape-bf23e1b45a6ed8990ca3401064840159eeeb47cb.tar.gz
inkscape-bf23e1b45a6ed8990ca3401064840159eeeb47cb.zip
SignalObserver: fix further refcounting issue in signal observer
(bzr r13427)
Diffstat (limited to 'src/xml/helper-observer.cpp')
-rw-r--r--src/xml/helper-observer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xml/helper-observer.cpp b/src/xml/helper-observer.cpp
index e56ddc6f8..957f3df0a 100644
--- a/src/xml/helper-observer.cpp
+++ b/src/xml/helper-observer.cpp
@@ -8,6 +8,11 @@ SignalObserver::SignalObserver()
: _oldsel(NULL)
{}
+SignalObserver::~SignalObserver()
+{
+ set(NULL); // if _oldsel!=nullptr, remove observer and decrease refcount
+}
+
// Add this observer to the SPObject and remove it from any previous object
void SignalObserver::set(SPObject* o)
{