From: Paul Davis Date: Sat, 2 Jun 2012 16:01:18 +0000 (+0000) Subject: remember to disconnect the _notify object when an AU GUI is destroyed X-Git-Tag: 3.0~1285 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=c1f46b15d2d84b1cf6849635996192b146580fde;p=ardour.git remember to disconnect the _notify object when an AU GUI is destroyed git-svn-id: svn://localhost/ardour2/branches/3.0@12545 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm index 21e471fa18..359b32478a 100644 --- a/gtk2_ardour/au_pluginui.mm +++ b/gtk2_ardour/au_pluginui.mm @@ -195,11 +195,13 @@ AUPluginUI::AUPluginUI (boost::shared_ptr 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