Address leaked strings and item references

This commit is contained in:
Christian Dywan 2011-04-26 01:29:26 +02:00
parent 00f848b27c
commit 1011d5c5b5
3 changed files with 11 additions and 13 deletions

View 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);

View 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);
}
}

View 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);
}