From: David Woodhouse Date: Sat, 9 Dec 2017 08:59:38 +0000 (+0000) Subject: Disconnect signals before tearing down state X-Git-Tag: v0.9~90 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=054ea599b863aa7daac72bae148a420a73cf6036;p=pidgin-chime.git Disconnect signals before tearing down state Otherwise, the new-meeting and other signals could fire and add things back when we're tearing it down. --- diff --git a/chime.c b/chime.c index 5e822b1..f19578b 100644 --- a/chime.c +++ b/chime.c @@ -235,15 +235,16 @@ static void chime_purple_close(PurpleConnection *conn) { struct purple_chime *pc = purple_connection_get_protocol_data(conn); + chime_connection_foreach_contact(pc->cxn, (ChimeContactCB)disconnect_contact, conn); + + g_signal_handlers_disconnect_matched(pc->cxn, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, conn); + purple_chime_destroy_meetings(conn); purple_chime_destroy_messages(conn); purple_chime_destroy_conversations(pc); purple_chime_destroy_chats(pc); - chime_connection_foreach_contact(pc->cxn, (ChimeContactCB)disconnect_contact, 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);