diff options
-rw-r--r-- | gtk2_ardour/editor_audio_import.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/interthread_progress_window.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/interthread_progress_window.h | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index ced2e7cb3d..e35e566dee 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -507,7 +507,10 @@ Editor::import_sndfiles (vector<string> paths, gtk_main_iteration (); } - import_status.done = true; + // wait for thread to terminate + while (!import_status.done) { + gtk_main_iteration (); + } int result = -1; diff --git a/gtk2_ardour/interthread_progress_window.cc b/gtk2_ardour/interthread_progress_window.cc index e63bf629a9..2f64644d5d 100644 --- a/gtk2_ardour/interthread_progress_window.cc +++ b/gtk2_ardour/interthread_progress_window.cc @@ -56,6 +56,14 @@ InterthreadProgressWindow::InterthreadProgressWindow (ARDOUR::InterThreadInfo* i } void +InterthreadProgressWindow::on_hide () +{ + if (!_interthread_info->done) { + _interthread_info->cancel = true; + } +} + +void InterthreadProgressWindow::cancel_clicked () { _interthread_info->cancel = true; diff --git a/gtk2_ardour/interthread_progress_window.h b/gtk2_ardour/interthread_progress_window.h index 653ec46420..ee7b58ee16 100644 --- a/gtk2_ardour/interthread_progress_window.h +++ b/gtk2_ardour/interthread_progress_window.h @@ -42,6 +42,7 @@ public: protected: virtual bool update (); + virtual void on_hide (); Gtk::Button _cancel_button; Gtk::Label _cancel_label; |