mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 15:13:39 +02:00
FunctionDispatcher now checks to prevent dealocking the GUI thread
This commit is contained in:
commit
64bfefa330
1 changed files with 2 additions and 0 deletions
|
|
@ -307,6 +307,8 @@ def __init__(self, func, queued=True, parent=None):
|
|||
self.lock = threading.Lock()
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
if is_gui_thread():
|
||||
return self.func(*args, **kwargs)
|
||||
with self.lock:
|
||||
self.dispatch_signal.emit(self.q, args, kwargs)
|
||||
res = self.q.get()
|
||||
|
|
|
|||
Loading…
Reference in a new issue