mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
wait for engine threads to stop before exiting
This commit is contained in:
parent
608a8548fb
commit
c624557a41
@ -23,7 +23,7 @@ class IEngine:
|
|||||||
# 0 - off, 1 - running, 2 - quitting
|
# 0 - off, 1 - running, 2 - quitting
|
||||||
self.state = 0
|
self.state = 0
|
||||||
self.window = None
|
self.window = None
|
||||||
self.thread = None
|
self.thread: Thread = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def gui(self):
|
def gui(self):
|
||||||
@ -47,6 +47,10 @@ class IEngine:
|
|||||||
self.thread = Thread(target=self._crash_safe)
|
self.thread = Thread(target=self._crash_safe)
|
||||||
self.thread.start()
|
self.thread.start()
|
||||||
|
|
||||||
|
def join(self):
|
||||||
|
if self.thread:
|
||||||
|
self.thread.join()
|
||||||
|
|
||||||
def turn_off(self):
|
def turn_off(self):
|
||||||
"""
|
"""
|
||||||
this method only signals the thread to close using start flag,
|
this method only signals the thread to close using start flag,
|
||||||
|
@ -71,6 +71,8 @@ class EngineEventHandler(IEngineHandler):
|
|||||||
self.quit_me()
|
self.quit_me()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
self.semi_fisher_engine.join()
|
||||||
|
self.full_fisher_engine.join()
|
||||||
if self.update_flag:
|
if self.update_flag:
|
||||||
auto_update.update_now(self.to_version)
|
auto_update.update_now(self.to_version)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user