mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
fix last failing test -- make account.shutdown() robust against getting called from event thread
This commit is contained in:
@@ -636,6 +636,7 @@ class Account(object):
|
||||
self._shutdown_event.set()
|
||||
hook = hookspec.Global._get_plugin_manager().hook
|
||||
hook.dc_account_after_shutdown(account=self, dc_context=dc_context)
|
||||
self.log("shutdown finished")
|
||||
|
||||
|
||||
def _destroy_dc_context(dc_context, dc_context_unref=lib.dc_context_unref):
|
||||
|
||||
@@ -147,6 +147,10 @@ class EventThread(threading.Thread):
|
||||
self._thread_quitflag = True
|
||||
|
||||
if wait:
|
||||
if self == threading.current_thread():
|
||||
# we are in the callback thread and thus cannot
|
||||
# wait for the thread-loop to finish.
|
||||
return
|
||||
self.join()
|
||||
|
||||
def run(self):
|
||||
|
||||
Reference in New Issue
Block a user