1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

plugins/inara: Avoid Tk event_generate() calls during shutdown

This commit is contained in:
Athanasius 2021-01-11 16:45:45 +00:00
parent bca0231dfc
commit 111f445cac

View File

@ -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('<<InaraLocation>>', when="tail")
if not config.shutting_down():
# calls update_location in main thread
this.system_link.event_generate('<<InaraLocation>>', 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('<<InaraShip>>', when="tail")
if not config.shutting_down():
# calls update_ship in main thread
this.system_link.event_generate('<<InaraShip>>', when="tail")
return True # regardless of errors above, we DID manage to send it, therefore inform our caller as such