summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2010-12-30 13:38:56 -0200
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2010-12-31 11:20:39 -0200
commitfbbcd582657e5f863df981d91cfee7750b6fa68c (patch)
treea382fadf983f5cccb2cbb8d8a533a051a2cd422a
parent4968d0204fdcba2a9c3d9a7749623e9d1b26269f (diff)
Connection: Don't leak contact list channels.
-rw-r--r--TelepathyQt4/connection.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/TelepathyQt4/connection.cpp b/TelepathyQt4/connection.cpp
index 88881eee..e704dd53 100644
--- a/TelepathyQt4/connection.cpp
+++ b/TelepathyQt4/connection.cpp
@@ -1906,6 +1906,10 @@ void Connection::gotContactListChannel(PendingOperation *op)
mPriv->contactListChannels[i].handle[0] == handle) {
Q_ASSERT(!mPriv->contactListChannels[i].channel);
mPriv->contactListChannels[i].channel = channel;
+ // deref connection refcount here as connection will keep a ref to channel and we don't
+ // want a contact list channel keeping a ref of connection, otherwise connection will
+ // leak, thus the channels.
+ channel->connection()->deref();
connect(channel->becomeReady(),
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(contactListChannelReady()));