diff options
author | Marco Pesenti Gritti <mpgritti gmail com> | 2008-09-15 18:09:00 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-09-15 18:09:00 +0100 |
commit | 6a945076699cd0a5eebde6bcf22a3cc4a4f9e547 (patch) | |
tree | 2cd2a630b816248bc6d87e6671c106c54767ec44 /dbus | |
parent | 81d0dcd79e1bc6187faa2f6a2f6d4d821f879a0e (diff) |
Cleanup self._signal_recipients_by_object_path (fd.o #17551)
In Connection, add_signal_receiver adds object paths to
self._signal_recipients_by_object_path and they are not cleaned by
remove_signal_receiver.
As a result self._signal_recipients_by_object_path keeps growing indefinitely.
This seem to work for me. I know very little about dbus-python though, so I
could very well be doing it wrong.
https://bugs.freedesktop.org/show_bug.cgi?id=17551
https://bugs.freedesktop.org/attachment.cgi?id=18857
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/connection.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dbus/connection.py b/dbus/connection.py index e2ec3b2..d76aaf2 100644 --- a/dbus/connection.py +++ b/dbus/connection.py @@ -484,7 +484,15 @@ class Connection(_Connection): deletions.append(match) else: new.append(match) - by_member[signal_name] = new + + if new: + by_member[signal_name] = new + else: + del by_member[signal_name] + if not by_member: + del by_interface[dbus_interface] + if not by_interface: + del self._signal_recipients_by_object_path[path] finally: self._signals_lock.release() |