From 19acf89d2a2f33ea98c152248d2b6914399e66f7 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Wed, 27 May 2015 08:50:00 -0500 Subject: [PATCH] Fix for bug #869 --- src/effects/Effect.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index ab3644037..7d3bd42f7 100755 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -2522,21 +2522,24 @@ void Effect::Preview(bool dryOnly) if (token) { int previewing = eProgressSuccess; - mProgress = new ProgressDialog(GetName(), - _("Previewing"), pdlgHideCancelButton); + // The progress dialog must be deleted before stopping the stream + // to allow events to flow to the app during StopStream processing. + // The progress dialog blocks these events. + ProgressDialog *progress = + new ProgressDialog(GetName(), _("Previewing"), pdlgHideCancelButton); while (gAudioIO->IsStreamActive(token) && previewing == eProgressSuccess) { ::wxMilliSleep(100); - previewing = mProgress->Update(gAudioIO->GetStreamTime() - mT0, mT1); + previewing = progress->Update(gAudioIO->GetStreamTime() - mT0, mT1); } + + delete progress; + gAudioIO->StopStream(); while (gAudioIO->IsBusy()) { ::wxMilliSleep(100); } - - delete mProgress; - mProgress = NULL; } else { wxMessageBox(_("Error while opening sound device. Please check the playback device settings and the project sample rate."),