pidgin: 05ca7c0f: Close open requests related to this xfer...

markdoliner at pidgin.im markdoliner at pidgin.im
Mon Nov 22 04:20:47 EST 2010


----------------------------------------------------------------------
Revision: 05ca7c0f8c782c05e9866a9ac6ccc03acc7d2c7f
Parent:   d74257412b7f467114a70c449b96a3930038aac7
Author:   markdoliner at pidgin.im
Date:     11/22/10 04:16:49
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/05ca7c0f8c782c05e9866a9ac6ccc03acc7d2c7f

Changelog: 

Close open requests related to this xfer when the request is canceled
locally.  For oscar this includes disconnecting when you have an
incoming transfer request.  Without this change Pidgin will crash if
the user tries to interact with the dialog.  This change fixes #11666.

Now instead of crashing we'll leak.  See the lengthy comment in the
code if anyone wants to fix this.

Changes against parent d74257412b7f467114a70c449b96a3930038aac7

  patched  libpurple/ft.c

-------------- next part --------------
============================================================
--- libpurple/ft.c	89aed01fc8502b575f70a455a6853d38403486ec
+++ libpurple/ft.c	25f2e7cdb8cac8635d2f2085f5c3216d9440613d
@@ -1488,6 +1488,20 @@ purple_xfer_cancel_local(PurpleXfer *xfe
 
 	g_return_if_fail(xfer != NULL);
 
+	/* TODO: We definitely want to close any open request dialogs associated
+	   with this transfer.  However, in some cases the request dialog might
+	   own a reference on the xfer.  This happens at least with the "%s wants
+	   to send you %s" dialog from purple_xfer_ask_recv().  In these cases
+	   the ref count will not be decremented when the request dialog is
+	   closed, so the ref count will never reach 0 and the xfer will never
+	   be freed.  This is a memleak and should be fixed.  It's not clear what
+	   the correct fix is.  Probably requests should have a destroy function
+	   that is called when the request is destroyed.  But also, ref counting
+	   xfer objects makes this code REALLY complicated.  An alternate fix is
+	   to not ref count and instead just make sure the object still exists
+	   when we try to use it. */
+	purple_request_close_with_handle(xfer);
+
 	purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_LOCAL);
 	xfer->end_time = time(NULL);
 


More information about the Commits mailing list