diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-06-07 18:32:16 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-06-07 18:32:16 +0800 |
commit | 1f163449e5d1a61b2c71755bfb796fbf14883f90 (patch) | |
tree | cca4418d44c3abc086f874d40fd501e753fa08f5 | |
parent | 9cfd57529bd0b209829be75b84390e782d756f74 (diff) | |
download | gsoc2013-epiphany-1f163449e5d1a61b2c71755bfb796fbf14883f90.tar gsoc2013-epiphany-1f163449e5d1a61b2c71755bfb796fbf14883f90.tar.gz gsoc2013-epiphany-1f163449e5d1a61b2c71755bfb796fbf14883f90.tar.bz2 gsoc2013-epiphany-1f163449e5d1a61b2c71755bfb796fbf14883f90.tar.lz gsoc2013-epiphany-1f163449e5d1a61b2c71755bfb796fbf14883f90.tar.xz gsoc2013-epiphany-1f163449e5d1a61b2c71755bfb796fbf14883f90.tar.zst gsoc2013-epiphany-1f163449e5d1a61b2c71755bfb796fbf14883f90.zip |
Fix mem leaks.
2003-06-07 Christian Persch <chpe@cvs.gnome.org>
* src/window-commands.c: (window_cmd_tabs_detach),
(window_cmd_file_bookmark_page):
Fix mem leaks.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/window-commands.c | 14 |
2 files changed, 14 insertions, 7 deletions
@@ -1,3 +1,10 @@ +2003-06-07 Christian Persch <chpe@cvs.gnome.org> + + * src/window-commands.c: (window_cmd_tabs_detach), + (window_cmd_file_bookmark_page): + + Fix mem leaks. + 2003-06-07 Marco Pesenti Gritti <marco@it.gnome.org> * data/art/epiphany-secure.png: diff --git a/src/window-commands.c b/src/window-commands.c index 77a0db07f..fd499f243 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -283,7 +283,7 @@ window_cmd_file_bookmark_page (EggAction *action, GtkWidget *new_bookmark; const char *location; const char *icon; - char *title; + char *title = NULL; tab = ephy_window_get_active_tab (window); g_return_if_fail (tab); @@ -294,7 +294,7 @@ window_cmd_file_bookmark_page (EggAction *action, location = ephy_tab_get_location (tab); if (ephy_embed_get_title (embed, &title) != G_OK) { - title = _("Untitled"); + title = g_strdup (_("Untitled")); } icon = ephy_tab_get_favicon_url (tab); @@ -311,6 +311,8 @@ window_cmd_file_bookmark_page (EggAction *action, (EPHY_NEW_BOOKMARK (new_bookmark), icon); gtk_widget_show (new_bookmark); } + + g_free (title); } void @@ -890,13 +892,11 @@ window_cmd_tabs_detach (EggAction *action, EphyWindow *window) { EphyTab *tab; - GtkWidget *src_page; + GtkWidget *src_page, *nb; EphyWindow *new_win; - if (g_list_length (ephy_window_get_tabs (window)) <= 1) - { - return; - } + nb = ephy_window_get_notebook (window); + if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb)) <= 1) return; tab = ephy_window_get_active_tab (window); src_page = GTK_WIDGET (ephy_tab_get_embed (tab)); |