diff --git a/src/damaris/gui/DamarisGUI.py b/src/damaris/gui/DamarisGUI.py index d867be4..d622ca8 100644 --- a/src/damaris/gui/DamarisGUI.py +++ b/src/damaris/gui/DamarisGUI.py @@ -471,9 +471,10 @@ class DamarisGUI: self.id = self.lockfile.add_experiment() while not self.lockfile.am_i_next(): - self.stop_experiment_flag.wait(interval) while gtk.events_pending(): gtk.main_iteration_do(False) + if self.stop_experiment_flag.wait(interval): + break if loop_run > 1: self.experiment_script_statusbar_label.set_text("Waiting for other experiment to finish") loop_run = 0 @@ -524,7 +525,10 @@ class DamarisGUI: print("waiting for threads stoping...", end=' ') still_running = [x for x in [ self.si.exp_handling, self.si.res_handling, self.si.back_driver ] if x is not None and x.is_alive( )] for t in still_running: - t.join( ) + while t.is_alive(): + while gtk.events_pending(): + gtk.main_iteration_do(False) + t.join( 0.05 ) print("done") # cleanup @@ -3312,6 +3316,8 @@ class ScriptInterface: self.back_driver.start( ) while (not self.back_driver.quit_flag.isSet( ) and \ (self.back_driver.core_pid is None or self.back_driver.core_pid <= 0)): + while gtk.events_pending(): + gtk.main_iteration_do(False) self.back_driver.quit_flag.wait( 0.1 ) if self.exp_handling: self.exp_handling.start( )