mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
FunctionDispatcher now checks to prevent dealocking the GUI thread
This commit is contained in:
commit
64bfefa330
@ -307,6 +307,8 @@ class FunctionDispatcher(QObject):
|
|||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
|
|
||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
|
if is_gui_thread():
|
||||||
|
return self.func(*args, **kwargs)
|
||||||
with self.lock:
|
with self.lock:
|
||||||
self.dispatch_signal.emit(self.q, args, kwargs)
|
self.dispatch_signal.emit(self.q, args, kwargs)
|
||||||
res = self.q.get()
|
res = self.q.get()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user