Fix g_object_add/remove_weak_pointer usage to prevent a crash when
authorDan Winship <danw@src.gnome.org>
Mon, 22 Aug 2005 14:28:27 +0000 (14:28 +0000)
committerDan Winship <danw@src.gnome.org>
Mon, 22 Aug 2005 14:28:27 +0000 (14:28 +0000)
* libsoup/soup-connection.c (set_current_request,
clear_current_request): Fix g_object_add/remove_weak_pointer usage
to prevent a crash when canceling a request. From Tambet.

ChangeLog
libsoup/soup-connection.c

index 2a3331e..35e31c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-22  Dan Winship  <danw@novell.com>
+
+       * libsoup/soup-connection.c (set_current_request,
+       clear_current_request): Fix g_object_add/remove_weak_pointer usage
+       to prevent a crash when canceling a request. From Tambet.
+
 2005-08-16  Dan Winship  <danw@novell.com>
 
        Fix a connection leak reported by Tambet.
index d54ec6c..d75ec4a 100644 (file)
@@ -346,7 +346,7 @@ set_current_request (SoupConnectionPrivate *priv, SoupMessage *req)
        req->status = SOUP_MESSAGE_STATUS_RUNNING;
        priv->cur_req = req;
        priv->in_use = TRUE;
-       g_object_add_weak_pointer (G_OBJECT (req), (gpointer *)priv->cur_req);
+       g_object_add_weak_pointer (G_OBJECT (req), (gpointer *)&priv->cur_req);
 }
 
 static void
@@ -361,7 +361,7 @@ clear_current_request (SoupConnection *conn)
                        priv->last_used = time (NULL);
 
                g_object_remove_weak_pointer (G_OBJECT (priv->cur_req),
-                                             (gpointer *)priv->cur_req);
+                                             (gpointer *)&priv->cur_req);
                priv->cur_req = NULL;
        }
        priv->in_use = FALSE;