changeset 25222:d6351b105e42

Call purple_xfer_end when ending an IBB session. This should ensure we close open files kept by PurpleXfer object
author Marcus Lundblad <ml@update.uu.se>
date Wed, 01 Oct 2008 18:19:00 +0000
parents 6e0f1532eb3d
children 034723cbdf23 51cbb9be484e
files libpurple/protocols/jabber/si.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/si.c	Tue Sep 30 21:48:09 2008 +0000
+++ b/libpurple/protocols/jabber/si.c	Wed Oct 01 18:19:00 2008 +0000
@@ -956,11 +956,11 @@
 	if (purple_xfer_get_bytes_remaining(xfer) > 0) {
 		purple_xfer_error(purple_xfer_get_type(xfer), account,
 			jabber_ibb_session_get_who(sess), _("Transfer was closed."));
-		purple_xfer_end(xfer);
 	} else {
 		purple_xfer_set_completed(xfer, TRUE);
 	}
 	jabber_si_xfer_free(xfer);
+	purple_xfer_end(xfer);
 }
 
 static void
@@ -984,6 +984,7 @@
 		if (purple_xfer_get_bytes_remaining(xfer) == 0) {
 			purple_xfer_set_completed(xfer, TRUE);
 			jabber_si_xfer_free(xfer);
+			purple_xfer_end(xfer);
 		}
 	} else {
 		/* trying to write past size of file transfers negotiated size,
@@ -991,6 +992,7 @@
 		purple_debug_error("jabber", 
 			"IBB file transfer, trying to write past end of file\n");
 		jabber_si_xfer_cancel_recv(xfer);
+		purple_xfer_end(xfer);
 	}
 	
 }
@@ -1027,6 +1029,7 @@
 		/* failed to create IBB session */
 		purple_debug_error("jabber", "failed to create IBB session\n");
 		jabber_si_xfer_cancel_recv(xfer);
+		purple_xfer_end(xfer);
 		return FALSE;
 	}
 }
@@ -1069,6 +1072,7 @@
 		jabber_ibb_session_close(sess);
 		purple_xfer_set_completed(xfer, TRUE);
 		jabber_si_xfer_free(xfer);
+		purple_xfer_end(xfer);
 	} else {
 		/* send more... */
 		jabber_si_xfer_ibb_send_data(sess);