remember to disconnect the _notify object when an AU GUI is destroyed
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 2 Jun 2012 16:01:18 +0000 (16:01 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 2 Jun 2012 16:01:18 +0000 (16:01 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12545 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/au_pluginui.mm

index 21e471fa186318359109820e261dbe125b827565..359b32478aef7ab14fcc509ff74dc2acfc0892f6 100644 (file)
@@ -195,11 +195,13 @@ AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
 
 AUPluginUI::~AUPluginUI ()
 {
+        if (_notify) {
+                [[NSNotificationCenter defaultCenter] removeObserver:_notify];
+        }
+
        if (cocoa_parent) {
                NSWindow* win = get_nswindow();
-               [[NSNotificationCenter defaultCenter] removeObserver:_notify];
                [win removeChildWindow:cocoa_parent];
-
        } 
 
 #ifdef WITH_CARBON