From abe013ad5ea181efcc97e71665a163296f531c0b Mon Sep 17 00:00:00 2001 From: Paolo Tormene Date: Wed, 19 Jun 2019 10:05:48 +0200 Subject: [PATCH 1/2] Stop any running timers on unload --- svir/dialogs/show_console_dialog.py | 5 ++++- svir/irmt.py | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/svir/dialogs/show_console_dialog.py b/svir/dialogs/show_console_dialog.py index d15300b10..fd60e30e5 100644 --- a/svir/dialogs/show_console_dialog.py +++ b/svir/dialogs/show_console_dialog.py @@ -52,7 +52,6 @@ def __init__(self, driver_dialog, calc_id): def refresh_calc_log(self): calc_status = self.driver_dialog.get_calc_status(self.calc_id) if calc_status is None: - self.timer.stop() self.reject() return if calc_status['status'] in ('complete', 'failed'): @@ -60,3 +59,7 @@ def refresh_calc_log(self): calc_log = self.driver_dialog.get_calc_log(self.calc_id) if calc_log: self.text_browser.append(calc_log) + + def reject(self): + self.timer.stop() + super().reject() diff --git a/svir/irmt.py b/svir/irmt.py index f56eb99ff..41edf5d73 100644 --- a/svir/irmt.py +++ b/svir/irmt.py @@ -556,6 +556,11 @@ def unload(self): """ Remove all plugin's actions and corresponding buttons and connects """ + + # stop any running timers + if self.drive_oq_engine_server_dlg is not None: + self.drive_oq_engine_server_dlg.reject() + # Remove the plugin menu items and toolbar icons for action_name in self.registered_actions: action = self.registered_actions[action_name] From 29e9e35e77736eabf14cae6d924b0fa63226f9b0 Mon Sep 17 00:00:00 2001 From: Paolo Tormene Date: Wed, 19 Jun 2019 10:11:23 +0200 Subject: [PATCH 2/2] Update changelog --- svir/metadata.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/svir/metadata.txt b/svir/metadata.txt index 733a31401..5f150e25c 100644 --- a/svir/metadata.txt +++ b/svir/metadata.txt @@ -25,6 +25,7 @@ email=staff.it@globalquakemodel.org changelog= 3.6.0 * Changed the realizations output for OQ-Engine scenario calculations, displaying the GSIM names instead of the branch path + * All possibly running timers are stopped before the plugin is unloaded 3.5.3 * The GUI elements for loading OQ-Engine outputs are in a scrollable area, usable also on low resolution screens * Some GUI sections can be expanded/collapsed