From bf23e1b45a6ed8990ca3401064840159eeeb47cb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 16 Jun 2014 20:26:07 +0200 Subject: SignalObserver: fix further refcounting issue in signal observer (bzr r13427) --- src/xml/helper-observer.cpp | 5 +++++ src/xml/helper-observer.h | 1 + 2 files changed, 6 insertions(+) (limited to 'src/xml') 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) { diff --git a/src/xml/helper-observer.h b/src/xml/helper-observer.h index e7881cd4d..2f70ba792 100644 --- a/src/xml/helper-observer.h +++ b/src/xml/helper-observer.h @@ -17,6 +17,7 @@ namespace Inkscape { { public: SignalObserver(); + ~SignalObserver(); // Add this observer to the SPObject and remove it from any previous object void set(SPObject* o); -- cgit v1.2.3