[kupfer] helplib: WeakCallback unregister dbus already on object deletion
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] helplib: WeakCallback unregister dbus already on object deletion
- Date: Mon, 7 Sep 2009 21:49:42 +0000 (UTC)
commit b9d3a07c4e459a0be7a34beefb6b5c024269b58d
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Thu Sep 3 19:15:00 2009 +0200
helplib: WeakCallback unregister dbus already on object deletion
Since we can, we unregister dbus signals already on object deletion.
Unregistering gobject signals on deletion is not trivial, since we
can't save a reference (or weak reference) to the sender.
kupfer/helplib.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/helplib.py b/kupfer/helplib.py
index 30be8c8..054df32 100644
--- a/kupfer/helplib.py
+++ b/kupfer/helplib.py
@@ -34,7 +34,9 @@ class WeakCallback (object):
sender = args[0]
sender.disconnect(self.gobject_token)
self.gobject_token = None
- elif self.dbus_token:
+
+ def object_deleted(self, wref):
+ if self.dbus_token:
self.dbus_token.remove()
self.dbus_token = None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]