diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2014-06-16 18:26:07 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2014-06-16 18:26:07 +0000 |
| commit | bf23e1b45a6ed8990ca3401064840159eeeb47cb (patch) | |
| tree | 19bdfc28ad0db01f9021b114a6b9e57f0a4b3619 /src/xml | |
| parent | add proper refcounting to XML SignalObserver. not refcounting caused crash up... (diff) | |
| download | inkscape-bf23e1b45a6ed8990ca3401064840159eeeb47cb.tar.gz inkscape-bf23e1b45a6ed8990ca3401064840159eeeb47cb.zip | |
SignalObserver: fix further refcounting issue in signal observer
(bzr r13427)
Diffstat (limited to 'src/xml')
| -rw-r--r-- | src/xml/helper-observer.cpp | 5 | ||||
| -rw-r--r-- | src/xml/helper-observer.h | 1 |
2 files changed, 6 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) { 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); |
