Changeset 9076a1c for protocols


Ignore:
Timestamp:
2015-07-27T23:48:04Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
10d089d
Parents:
31e2b09
Message:

Fix cleanup of (RPC) groupchats, fixes some crashes at logout time.

Location:
protocols
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r31e2b09 r9076a1c  
    413413
    414414        query_del_by_conn((irc_t *) ic->bee->ui_data, ic);
     415
     416        /* Throw away groupchats owned by this account. Historically this was only
     417           ever done by IM modules which is a bug. But it gives them opportunity
     418           to clean up protocol-specific bits as well so keep it that way, just
     419           do another cleanup here as a fallback. Don't want to leave any dangling
     420           pointers! */
     421        while (ic->groupchats) {
     422                imcb_chat_free(ic->groupchats->data);
     423        }
    415424
    416425        if (!a) {
  • protocols/rpc/rpc.c

    r31e2b09 r9076a1c  
    409409        json_array_append_integer(params, rc->id);
    410410        rpc_send(gc->ic, rpc);
     411
     412        struct rpc_connection *rd = gc->ic->proto_data;
     413        g_hash_table_remove(rd->groupchats, &rc->id);
    411414        rpc_groupchat_free(gc);
    412415}
     
    438441}
    439442
     443/* When calling this, also make sure the element gets removes from
     444   rpc_connection->groupchat. This function doesn't do that because it gets
     445   called from within an iterator. */
    440446static void rpc_groupchat_free(struct groupchat *gc) {
    441447        g_free(gc->data);
Note: See TracChangeset for help on using the changeset viewer.