From ea112bddc1a9f53f0ff5bc5b50b9fbf74d22c4da Mon Sep 17 00:00:00 2001 From: lllucius Date: Tue, 6 Jan 2015 18:01:04 +0000 Subject: [PATCH] Fix crash reported by Steve Steps to reproduce: 1) Launch Audacity 2) File > New 3) Generate a sound in the new project 4) Open a LADSPA effect 5) In second project: File > Close, don't save changes. 6) In first project, generate a sound. 7) Click "Play" button - crash :-( --- src/effects/Effect.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 7187c5dc4..f77446d0f 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -2192,6 +2192,19 @@ EffectUIHost::~EffectUIHost() { if (mInitialized) { + mInitialized = false; + + wxTheApp->Disconnect(EVT_AUDIOIO_PLAYBACK, + wxCommandEventHandler(EffectUIHost::OnPlayback), + NULL, + this); + + wxTheApp->Disconnect(EVT_AUDIOIO_CAPTURE, + wxCommandEventHandler(EffectUIHost::OnCapture), + NULL, + this); + + EffectManager::Get().RealtimeRemoveEffect(mEffect); } if (mClient)