[Xfce4-commits] <midori:master> Address leaked strings and item references
Christian Dywan
noreply at xfce.org
Tue Apr 26 02:50:03 CEST 2011
Updating branch refs/heads/master
to 1011d5c5b58eee48a236715af863e96b85bd4104 (commit)
from 00f848b27c7efb4fa22b71f24d3d604bdeba2022 (commit)
commit 1011d5c5b58eee48a236715af863e96b85bd4104
Author: Christian Dywan <christian at twotoasts.de>
Date: Tue Apr 26 01:29:26 2011 +0200
Address leaked strings and item references
midori/midori-browser.c | 14 ++++----------
midori/midori-searchaction.c | 4 ++++
midori/midori-view.c | 6 +++---
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index a7c9f57..b326405 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -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);
diff --git a/midori/midori-searchaction.c b/midori/midori-searchaction.c
index 3206526..34d8374 100644
--- a/midori/midori-searchaction.c
+++ b/midori/midori-searchaction.c
@@ -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);
}
}
diff --git a/midori/midori-view.c b/midori/midori-view.c
index e86ca50..087d493 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -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);
}
More information about the Xfce4-commits
mailing list