aboutsummaryrefslogtreecommitdiffstats
path: root/src/session.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-01-20 08:19:13 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-01-20 08:19:13 +0800
commit5f2bf6e7fe67481c000fe9671a679feef79a2fcf (patch)
tree5b8407b11a0f143ff0289e509abc27f97cbac16e /src/session.c
parent29e1844f7711f8bcfb5f7c561c6368d6240a6c9b (diff)
downloadgsoc2013-epiphany-5f2bf6e7fe67481c000fe9671a679feef79a2fcf.tar
gsoc2013-epiphany-5f2bf6e7fe67481c000fe9671a679feef79a2fcf.tar.gz
gsoc2013-epiphany-5f2bf6e7fe67481c000fe9671a679feef79a2fcf.tar.bz2
gsoc2013-epiphany-5f2bf6e7fe67481c000fe9671a679feef79a2fcf.tar.lz
gsoc2013-epiphany-5f2bf6e7fe67481c000fe9671a679feef79a2fcf.tar.xz
gsoc2013-epiphany-5f2bf6e7fe67481c000fe9671a679feef79a2fcf.tar.zst
gsoc2013-epiphany-5f2bf6e7fe67481c000fe9671a679feef79a2fcf.zip
Port several leaks fixes from galeon.
2003-01-20 Marco Pesenti Gritti <marco@it.gnome.org> * embed/ephy-embed-event.c: (free_g_value), (ephy_embed_event_init), (ephy_embed_event_get_property): * embed/ephy-embed-event.h: * embed/ephy-embed-popup.c: (setup_document_menu), (embed_popup_copy_email_cmd), (embed_popup_copy_link_location_cmd), (save_property_url), (embed_popup_open_link_cmd), (embed_popup_set_image_as_background_cmd), (embed_popup_copy_image_location_cmd), (embed_popup_open_image_cmd): * embed/ephy-embed-utils.c: (build_charset), (ephy_embed_utils_build_charsets_submenu): * embed/mozilla/FilePicker.cpp: * src/bookmarks/ephy-bookmarks.c: (update_favorites_menus): * src/ephy-nautilus-view.c: (gnv_embed_dom_mouse_down_cb), (gnv_popup_cmd_new_window), (gnv_popup_cmd_image_in_new_window): * src/ephy-shell.c: (ephy_shell_get_active_window): * src/ephy-tab.c: (ephy_tab_dom_mouse_down_cb): * src/ephy-window.c: (update_window_visibility), (update_spinner_control): * src/general-prefs.c: (language_dialog_changed_cb): * src/popup-commands.c: (popup_cmd_new_window), (popup_cmd_new_tab), (popup_cmd_image_in_new_tab), (popup_cmd_image_in_new_window), (popup_cmd_add_bookmark): * src/session.c: (session_close), (session_save): * src/session.h: Port several leaks fixes from galeon.
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/session.c b/src/session.c
index 927f7fd95..d050a9dcd 100644
--- a/src/session.c
+++ b/src/session.c
@@ -357,15 +357,16 @@ session_init (Session *session)
void
session_close (Session *session)
{
- GList *l;
+ GList *l, *windows;
/* close all windows */
- l = g_list_copy (session->priv->windows);
- for (; l != NULL; l = l->next)
+ windows = g_list_copy (session->priv->windows);
+ for (l = windows; l != NULL; l = l->next)
{
EphyWindow *window = EPHY_WINDOW(l->data);
gtk_widget_destroy (GTK_WIDGET(window));
}
+ g_list_free (windows);
}
static void
@@ -474,7 +475,7 @@ void
session_save (Session *session,
const char *filename)
{
- GList *w;
+ const GList *w;
xmlNodePtr root_node;
xmlNodePtr window_node;
xmlDocPtr doc;
@@ -494,7 +495,7 @@ session_save (Session *session,
/* iterate through all the windows */
for (; w != NULL; w = w->next)
{
- const GList *tabs;
+ GList *tabs, *l;
int x = 0, y = 0, width = 0, height = 0;
EphyWindow *window = EPHY_WINDOW(w->data);
GtkWidget *wmain;
@@ -521,11 +522,12 @@ session_save (Session *session,
snprintf(buffer, 32, "%d", height);
xmlSetProp (window_node, "height", buffer);
- for (; tabs != NULL; tabs = tabs->next)
+ for (l = tabs; l != NULL; l = l->next)
{
EphyTab *tab = EPHY_TAB(tabs->data);
save_tab (window, tab, doc, window_node);
}
+ g_list_free (tabs);
xmlAddChild (root_node, window_node);
}
@@ -637,7 +639,7 @@ session_load (Session *session,
g_free (save_to);
}
-GList *
+const GList *
session_get_windows (Session *session)
{
g_return_val_if_fail (IS_SESSION (session), NULL);