diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index 6fe098c33..f1a17a9a0 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -965,9 +965,12 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt)) wxString msg; msg.Printf(_("Enabling effects:\n\n%s"), last3.c_str()); - - ProgressDialog progress(GetTitle(), msg, pdlgHideStopButton); - progress.CenterOnParent(); + + // Make sure the progress dialog is deleted before we call EndModal() or + // we will leave the project window in an unusable state on OSX. + // See bug #1192. + ProgressDialog *progress = new ProgressDialog(GetTitle(), msg, pdlgHideStopButton); + progress->CenterOnParent(); int i = 0; for (ItemDataMap::iterator iter = mItems.begin(); iter != mItems.end(); ++iter) @@ -978,7 +981,7 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt)) if (item.state == STATE_Enabled && item.plugs[0]->GetPluginType() == PluginTypeStub) { last3 = last3.AfterFirst(wxT('\n')) + item.path + wxT("\n"); - int status = progress.Update(++i, enableCount, wxString::Format(_("Enabling effect:\n\n%s"), last3.c_str())); + int status = progress->Update(++i, enableCount, wxString::Format(_("Enabling effect:\n\n%s"), last3.c_str())); if (!status) { break; @@ -1016,6 +1019,8 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt)) pm.Save(); + delete progress; + EndModal(wxID_OK); }