summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2010-12-16 17:14:36 +0000
committerJonny Lamb <jonny.lamb@collabora.co.uk>2010-12-16 17:14:36 +0000
commit06a8413b7525c3c999b251b53e3f1817af134e90 (patch)
tree5bf1c70ca22a31c7cb9cac6f9aa8352b4c2c3da3
parent81614fb2093ed2e858dc5bb588c566e47d054cfd (diff)
server.channel: do Close cleanup parts separately
For example, if we create a channel without a channel manager, the first of these cleanups will fail, but the other two won't. Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--src/server/channel.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/channel.py b/src/server/channel.py
index eb9a560..a82cc43 100644
--- a/src/server/channel.py
+++ b/src/server/channel.py
@@ -101,9 +101,19 @@ class Channel(_Channel, DBusProperties):
@dbus.service.method(CHANNEL_INTERFACE, in_signature='', out_signature='')
def Close(self):
self.Closed()
+
+ # Do all these separately in case one works but another doesn't.
try:
self._chan_manager.remove_channel(self)
+ except:
+ pass
+
+ try:
self._conn.remove_channel(self)
+ except:
+ pass
+
+ try:
self.remove_from_connection()
except:
pass