From ab4dbff3e72e992c4af4492f2e780f2ac29a51a7 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 14 Jun 2008 06:39:57 +0000 Subject: [PATCH] Fix possible race condition when using force_call() --- deluge/ui/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deluge/ui/client.py b/deluge/ui/client.py index 7b9d8f901..1b8e9b3ab 100644 --- a/deluge/ui/client.py +++ b/deluge/ui/client.py @@ -82,6 +82,8 @@ class CoreProxy(gobject.GObject): def do_multicall(self, block=False): if len(self._callbacks) == 0: return True + # Remove the timer just in case this is a forced call.. + gobject.source_remove(self._multi_timer) if self._multi is not None and self.rpc_core is not None: try: @@ -100,6 +102,8 @@ class CoreProxy(gobject.GObject): self.set_core_uri(None) finally: self._callbacks = [] + # Re-enable the timer + self._multi_timer = gobject.timeout_add(200, self.do_multicall) self._multi = xmlrpclib.MultiCall(self.rpc_core) return True