libsoup r1053 - in trunk: . libsoup



Author: danw
Date: Sun Jan 27 16:52:35 2008
New Revision: 1053
URL: http://svn.gnome.org/viewvc/libsoup?rev=1053&view=rev

Log:
	* libsoup/soup-session-async.c (final_finished): Don't run the
	queue again if the callback destroyed the session. #511868, Stef
	Walter.


Modified:
   trunk/ChangeLog
   trunk/libsoup/soup-session-async.c

Modified: trunk/libsoup/soup-session-async.c
==============================================================================
--- trunk/libsoup/soup-session-async.c	(original)
+++ trunk/libsoup/soup-session-async.c	Sun Jan 27 16:52:35 2008
@@ -196,18 +196,24 @@
 	SoupSessionAsyncQueueData *saqd = user_data;
 	SoupSessionAsync *sa = saqd->sa;
 
+	g_object_add_weak_pointer (G_OBJECT (sa), (gpointer)&sa);
+
 	if (!SOUP_MESSAGE_IS_STARTING (req)) {
 		g_signal_handlers_disconnect_by_func (req, final_finished, saqd);
 		if (saqd->callback) {
 			saqd->callback ((SoupSession *)sa, req,
 					saqd->callback_data);
+			/* callback might destroy sa */
 		}
 
 		g_object_unref (req);
 		g_slice_free (SoupSessionAsyncQueueData, saqd);
 	}
 
-	run_queue (sa, FALSE);
+	if (sa) {
+		g_object_remove_weak_pointer (G_OBJECT (sa), (gpointer)&sa);
+		run_queue (sa, FALSE);
+	}
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]