From 111f445cac62291870f2354eacf907c8020d22cc Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 11 Jan 2021 16:45:45 +0000 Subject: [PATCH] plugins/inara: Avoid Tk event_generate() calls during shutdown --- plugins/inara.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/inara.py b/plugins/inara.py index 4b61322c..9aeef582 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -1290,13 +1290,17 @@ def send_data(url: str, data: Mapping[str, Any]) -> bool: 'setCommanderTravelLocation' ): this.lastlocation = reply_event.get('eventData', {}) - # calls update_location in main thread - this.system_link.event_generate('<>', when="tail") + + if not config.shutting_down(): + # calls update_location in main thread + this.system_link.event_generate('<>', when="tail") elif data_event['eventName'] in ['addCommanderShip', 'setCommanderShip']: this.lastship = reply_event.get('eventData', {}) - # calls update_ship in main thread - this.system_link.event_generate('<>', when="tail") + + if not config.shutting_down(): + # calls update_ship in main thread + this.system_link.event_generate('<>', when="tail") return True # regardless of errors above, we DID manage to send it, therefore inform our caller as such