]> spindle.queued.net Git - midori/commitdiff
Always copy the cookie filename when attaching
authorChristian Dywan <christian@twotoasts.de>
Wed, 4 May 2011 21:53:45 +0000 (23:53 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 4 May 2011 21:53:45 +0000 (23:53 +0200)
Otherwise we'll have freed the original filename when
detaching and attaching again.

katze/katze-http-cookies.c

index 304bf8da07a5bafa5202d3e608444b0af4f3a797..a25f62a17eec414b3b7fd1efdc0f4017782541e9 100644 (file)
@@ -276,10 +276,11 @@ katze_http_cookies_attach (SoupSessionFeature* feature,
                            SoupSession*        session)
 {
     KatzeHttpCookies* http_cookies = (KatzeHttpCookies*)feature;
+    const gchar* filename = g_object_get_data (G_OBJECT (feature), "filename");
     SoupSessionFeature* jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);
     g_return_if_fail (jar != NULL);
-    http_cookies->filename = g_object_get_data (G_OBJECT (feature), "filename");
-    g_return_if_fail (http_cookies->filename != NULL);
+    g_return_if_fail (filename != NULL);
+    katze_assign (http_cookies->filename, g_strdup (filename));
     http_cookies->jar = g_object_ref (jar);
     cookie_jar_load (http_cookies->jar, http_cookies->filename);
     g_signal_connect (jar, "changed",