X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fchannel_manager.py;h=d1e99423e673110be5096d488d1baa317185a577;hb=2ae1b84f540554bcbe033c85d092c239a6fefef0;hp=906744ae3a45d90f5a63cfe97365ce17cb9ec4b2;hpb=0b0ee151c524532cb0cbd7d1905e517c61f50d63;p=theonering diff --git a/src/channel_manager.py b/src/channel_manager.py index 906744a..d1e9942 100644 --- a/src/channel_manager.py +++ b/src/channel_manager.py @@ -1,4 +1,5 @@ import weakref +import itertools import logging import telepathy @@ -18,12 +19,13 @@ class ChannelManager(object): self._callChannels = weakref.WeakValueDictionary() def close(self): - for chan in self._listChannels.values(): - chan.Close() - for chan in self._textChannels.values(): - chan.Close() - for chan in self._callChannels.values(): - chan.Close() + for chan in itertools.chain( + self._listChannels.values(), self._textChannels.values(), self._callChannels.values() + ): + try: + chan.close() + except Exception: + _moduleLogger.exception("Shutting down %r" % (chan, )) def channel_for_list(self, handle, suppress_handler=False): try: