summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_audio_import.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-05-21 23:30:11 +0200
committerRobin Gareus <robin@gareus.org>2016-05-21 23:30:11 +0200
commit03660573e28dbc3574d5964cc0392832b8f46557 (patch)
tree79c9786815951c32770258f0ea77a81e11444435 /gtk2_ardour/editor_audio_import.cc
parent9ad096b6110e55d7f74e9724cd67246416c090be (diff)
fix import-thread SNAFU
* pressing Esc or WM close button did not cancel import thread * proper Abort does not wait for import thread either It was possible to launch a 2nd (and Nth) import thread, all sharing the Editor's ImportStatus data-structure, all having the same registered thread-name and same thread-pool name. Plenty of room for crashes.
Diffstat (limited to 'gtk2_ardour/editor_audio_import.cc')
-rw-r--r--gtk2_ardour/editor_audio_import.cc5
1 files changed, 4 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;