]> spindle.queued.net Git - midori/commitdiff
Address leaked strings and item references
authorChristian Dywan <christian@twotoasts.de>
Mon, 25 Apr 2011 23:29:26 +0000 (01:29 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 25 Apr 2011 23:29:26 +0000 (01:29 +0200)
midori/midori-browser.c
midori/midori-searchaction.c
midori/midori-view.c

index a7c9f575d255b7e0be12bc8737e44260f8334280..b3264051dbea2e3d22d8f44ef6f4825d40d376b6 100644 (file)
@@ -249,7 +249,6 @@ static void
 _toggle_tabbar_smartly (MidoriBrowser* browser)
 {
     guint n;
-    gboolean always_show_tabbar;
 
     if (!browser->show_tabs)
         return;
@@ -257,9 +256,7 @@ _toggle_tabbar_smartly (MidoriBrowser* browser)
     n = gtk_notebook_get_n_pages (GTK_NOTEBOOK (browser->notebook));
     if (n < 2)
     {
-        g_object_get (browser->settings, "always-show-tabbar",
-            &always_show_tabbar, NULL);
-        if (always_show_tabbar)
+        if (katze_object_get_boolean (browser->settings, "always-show-tabbar"))
             n++;
     }
     gtk_notebook_set_show_tabs (GTK_NOTEBOOK (browser->notebook), n > 1);
@@ -3443,6 +3440,7 @@ _action_source_view_activate (GtkAction*     action,
         gchar* filename = g_filename_from_uri (uri, NULL, NULL);
         sokoke_spawn_program (text_editor, filename);
         g_free (filename);
+        g_free (text_editor);
         return;
     }
     katze_net_load_uri (NULL, uri, NULL,
@@ -6300,6 +6298,7 @@ _midori_browser_update_settings (MidoriBrowser* browser)
     gboolean close_buttons_on_tabs;
     KatzeItem* item;
 
+    g_free (browser->location_entry_search);
     g_free (browser->news_aggregator);
 
     g_object_get (browser->settings,
@@ -6602,12 +6601,7 @@ midori_browser_show_bookmarkbar_notify_value_cb (MidoriWebSettings* settings,
                                                  GParamSpec*        pspec,
                                                  MidoriBrowser*     browser)
 {
-    gboolean show_bookmarkbar;
-
-    g_object_get (browser->settings, "show-bookmarkbar",
-                  &show_bookmarkbar, NULL);
-
-    if (!show_bookmarkbar)
+    if (!katze_object_get_boolean (browser->settings, "show-bookmarkbar"))
         midori_bookmarkbar_clear (browser->bookmarkbar);
     else
         midori_bookmarkbar_populate (browser);
index 3206526c52ad1260710352b599eaef9fbf8a0cf7..34d837438cdf5ccc30bee308d4215ae367060612 100644 (file)
@@ -1034,6 +1034,7 @@ midori_search_action_get_editor (MidoriSearchAction* search_action,
            we need to update the default search engine after editing it. */
         else if (item == midori_search_action_get_default_item (search_action))
             midori_search_action_set_default_item (search_action, item);
+        g_object_unref (item);
     }
     gtk_widget_destroy (dialog);
 }
@@ -1123,6 +1124,7 @@ midori_search_action_dialog_move_up_cb (GtkWidget*          widget,
 
             i = katze_array_get_item_index (search_engines, item);
             katze_array_move_item (search_engines, item, i - 1);
+            g_object_unref (item);
             /* If the index of the current item has changed it needs to be reset */
             g_object_notify (G_OBJECT (search_action), "current-item");
         }
@@ -1155,6 +1157,7 @@ midori_search_action_dialog_move_down_cb (GtkWidget*          widget,
 
             i = katze_array_get_item_index (search_engines, item);
             katze_array_move_item (search_engines, item, i + 1);
+            g_object_unref (item);
             /* If the index of the current item has changed it needs to be reset */
             g_object_notify (G_OBJECT (search_action), "current-item");
         }
@@ -1236,6 +1239,7 @@ midori_search_action_dialog_engines_remove_item_cb (KatzeArray* list,
         }
         else
             valid = gtk_tree_model_iter_next (liststore, &iter);
+        g_object_unref (found_item);
     }
 }
 
index e86ca50655abddb24fe3fb41eea42665358b6d6e..087d4933163688846c004461ab4c77fa326b4bf9 100644 (file)
@@ -1858,10 +1858,10 @@ gtk_widget_button_press_event_cb (WebKitWebView*  web_view,
                     new_uri = sokoke_magic_uri (uri);
                     if (!new_uri)
                     {
-                        gchar* search;
-                        g_object_get (view->settings, "location-entry-search",
-                                      &search, NULL);
+                        gchar* search = katze_object_get_string (
+                            view->settings, "location-entry-search");
                         new_uri = sokoke_search_uri (search, uri);
+                        g_free (search);
                     }
                     katze_assign (uri, new_uri);
                 }