Ignore:
Timestamp:
2016-11-13T20:10:17Z (7 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
9f03c47
Parents:
701ab812
git-author:
dequis <dx@…> (13-11-16 20:00:04)
git-committer:
dequis <dx@…> (13-11-16 20:10:17)
Message:

purple: fix file transfer memory management

This means cancelling transfers on logout to avoid crashes, keeping
track of timeouts, reffing and unreffing the xfers, listening to the
callbacks from UI and purple more carefully and using the correct
functions to free the correct things at the correct moments.

Originally intended to fix a crash triggered when the dcc stall timeout
kicks in after the account is offline, which is apparently very frequent
with telegram (it sends file transfers while fetching history, and
randomly disconnects a while later).

Trying to fix that meant opening a can of worms, but after three days of
work on this bug I'm pretty sure I've finished dealing with the
resulting mess and tested all the typical edge cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    r701ab812 rea90275  
    4343                                   const char *message, const char *who);
    4444
     45void purple_transfer_cancel_all(struct im_connection *ic);
     46
    4547/* purple_request_input specific stuff */
    4648typedef void (*ri_callback_t)(gpointer, const gchar *);
     
    383385        while (ic->groupchats) {
    384386                imcb_chat_free(ic->groupchats->data);
     387        }
     388
     389        if (pd->filetransfers) {
     390                purple_transfer_cancel_all(ic);
    385391        }
    386392
Note: See TracChangeset for help on using the changeset viewer.