FunctionDispatcher now checks to prevent dealocking the GUI thread

This commit is contained in:
Kovid Goyal 2011-06-11 15:11:01 -06:00
commit 64bfefa330

View File

@ -307,6 +307,8 @@ class FunctionDispatcher(QObject):
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()