]> spindle.queued.net Git - midori/commitdiff
Don't load the soup session in idle callback
authorChristian Dywan <christian@twotoasts.de>
Sat, 16 Apr 2011 02:26:28 +0000 (04:26 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 16 Apr 2011 02:26:28 +0000 (04:26 +0200)
Otherwise there's a race condition which may lead to
not having setup the session before loading the first
page or worse, crash in libSoup.

midori/main.c

index 132b72e46c0e01af27a19b99fee6119cd8d040bd..91ca9115a5d35d06cb1b1ce3eec81a37c82cc3eb 100644 (file)
@@ -1228,6 +1228,8 @@ midori_load_soup_session_full (gpointer settings)
     gchar* config_file;
     SoupSessionFeature* feature;
 
+    midori_load_soup_session (settings);
+
     config_file = build_config_filename ("logins");
     feature = g_object_new (KATZE_TYPE_HTTP_AUTH, "filename", config_file, NULL);
     g_free (config_file);
@@ -1246,8 +1248,6 @@ midori_load_soup_session_full (gpointer settings)
     soup_session_add_feature (session, feature);
     g_object_unref (feature);
 
-    g_idle_add (midori_load_soup_session, settings);
-
     return FALSE;
 }
 
@@ -2267,7 +2267,7 @@ main (int    argc,
                 G_CALLBACK (midori_soup_session_block_uris_cb),
                 g_strdup (block_uris));
         midori_setup_inactivity_reset (browser, inactivity_reset, webapp);
-        g_idle_add (midori_load_soup_session, settings);
+        midori_load_soup_session (settings);
         midori_startup_timer ("App created: \t%f");
         gtk_main ();
         return 0;