]> www.infradead.org Git - pidgin-chime.git/commitdiff
Explicitly close ChimeConnection in chime_purple_close()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 5 Dec 2017 13:30:04 +0000 (13:30 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 5 Dec 2017 13:30:04 +0000 (13:30 +0000)
Instead of allowing it to be implicitly closed by the final unref, close
it explicitly. This allows us to fix up the refcounting elsewhere, so
the objects associated with the connection can just hold a ref to it.

It was kind of OK for rooms/conversations but it's getting silly with
meetings adn calls.

chime.c

diff --git a/chime.c b/chime.c
index fa22d37ddc7eac7739c78504399adab952cf6688..7c01b08c223d554f8ae3ee4a43ecc0bfd6754420 100644 (file)
--- a/chime.c
+++ b/chime.c
@@ -244,11 +244,12 @@ static void chime_purple_close(PurpleConnection *conn)
 
        g_signal_handlers_disconnect_matched(pc->cxn, G_SIGNAL_MATCH_DATA,
                                             0, 0, NULL, NULL, conn);
+       chime_connection_disconnect(pc->cxn);
        g_clear_object(&pc->cxn);
        g_free(pc);
        purple_connection_set_protocol_data(conn, NULL);
 
-       purple_debug(PURPLE_DEBUG_INFO, "chime", "Chime close");
+       purple_debug(PURPLE_DEBUG_INFO, "chime", "Chime close\n");
 }