wait for engine threads to stop before exiting

This commit is contained in:
Adam Saudagar 2022-02-03 04:50:36 +05:30
parent 608a8548fb
commit c624557a41
2 changed files with 7 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class IEngine:
# 0 - off, 1 - running, 2 - quitting
self.state = 0
self.window = None
self.thread = None
self.thread: Thread = None
@property
def gui(self):
@ -47,6 +47,10 @@ class IEngine:
self.thread = Thread(target=self._crash_safe)
self.thread.start()
def join(self):
if self.thread:
self.thread.join()
def turn_off(self):
"""
this method only signals the thread to close using start flag,

View File

@ -71,6 +71,8 @@ class EngineEventHandler(IEngineHandler):
self.quit_me()
def stop(self):
self.semi_fisher_engine.join()
self.full_fisher_engine.join()
if self.update_flag:
auto_update.update_now(self.to_version)