aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--src/window-commands.c14
2 files changed, 14 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index c668befaf..eea49d6b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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));