diff src/gtkft.c @ 8282:ab35a0bec13a

[gaim-migrate @ 9006] " This works around the crash on trying to send a file that's too big, by giving an error. It also makes Gaim not crash on canceling the send right there. It doesn't fix the crash on the server doing whatever it did to make us crash. Someone should send me a backtrace of trying to send say a 2meg file without this patch." --Tim Ringenbach committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 17 Feb 2004 18:45:25 +0000
parents fa6395637e2c
children ffa642240fc1
line wrap: on
line diff
--- a/src/gtkft.c	Tue Feb 17 15:58:20 2004 +0000
+++ b/src/gtkft.c	Tue Feb 17 18:45:25 2004 +0000
@@ -868,6 +868,8 @@
 	if (data == NULL)
 		return;
 
+	if (!data->in_list)
+		return;
 
 	if ((gaim_xfer_get_status(xfer) == GAIM_XFER_STATUS_CANCEL_LOCAL) && (dialog->auto_clear)) {
 		gaim_gtkxfer_dialog_remove_xfer(dialog, xfer);
@@ -1011,6 +1013,7 @@
 	g_free(data->name);
 	data->name = NULL;
 
+	gaim_xfer_unref(xfer);
 	return 0;
 }
 
@@ -1042,8 +1045,10 @@
 
 	name = gtk_file_selection_get_filename(GTK_FILE_SELECTION(data->filesel));
 
-	if (gaim_gtk_check_if_dir(name, GTK_FILE_SELECTION(data->filesel)))
+	if (gaim_gtk_check_if_dir(name, GTK_FILE_SELECTION(data->filesel))) {
+		gaim_xfer_unref(xfer);
 		return;
+	}
 
 	if (stat(name, &st) != 0) {
 		/* File not found. */
@@ -1072,6 +1077,7 @@
 		}
 		else if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) {
 			data->name = g_strdup(name);
+			gaim_xfer_ref(xfer);
 
 			gaim_request_yes_no(NULL, NULL,
 								_("That file already exists."),
@@ -1087,6 +1093,7 @@
 
 	gtk_widget_destroy(data->filesel);
 	data->filesel = NULL;
+	gaim_xfer_unref(xfer);
 }
 
 static int
@@ -1134,6 +1141,7 @@
 cancel_recv_cb(GaimXfer *xfer)
 {
 	gaim_xfer_request_denied(xfer);
+	gaim_xfer_unref(xfer);
 
 	return 0;
 }
@@ -1163,6 +1171,7 @@
 static void
 gaim_gtkxfer_request_file(GaimXfer *xfer)
 {
+	gaim_xfer_ref(xfer);
 	if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE)
 		gaim_gtkxfer_ask_recv(xfer);
 	else