diff options
author | Christian Persch <chpe@src.gnome.org> | 2003-08-02 21:11:02 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-08-02 21:11:02 +0800 |
commit | 9279c6b1a75518e24ef9c57b9f9113efa90a6cd6 (patch) | |
tree | 61d3e7d36b87f7301323ca15aa9eb6ac151002b9 | |
parent | 01b6a293d1724b772609c97ad8cdea49cb7ff53e (diff) | |
download | gsoc2013-epiphany-9279c6b1a75518e24ef9c57b9f9113efa90a6cd6.tar gsoc2013-epiphany-9279c6b1a75518e24ef9c57b9f9113efa90a6cd6.tar.gz gsoc2013-epiphany-9279c6b1a75518e24ef9c57b9f9113efa90a6cd6.tar.bz2 gsoc2013-epiphany-9279c6b1a75518e24ef9c57b9f9113efa90a6cd6.tar.lz gsoc2013-epiphany-9279c6b1a75518e24ef9c57b9f9113efa90a6cd6.tar.xz gsoc2013-epiphany-9279c6b1a75518e24ef9c57b9f9113efa90a6cd6.tar.zst gsoc2013-epiphany-9279c6b1a75518e24ef9c57b9f9113efa90a6cd6.zip |
2003-08-02 Christian Persch
* src/ephy-encodings-menu.c: (build_group):
Fix ui xml string.
* src/ephy-tabs-menu.c: (ephy_tabs_menu_update):
Fix mem leak.
* src/ephy-window.c: (remove_from_session), (ephy_window_destroy),
(ephy_window_finalize):
* src/session.h:
* src/session.c: (session_class_init), (session_remove_window):
Move up the removal of the window from the session to when it's still
valid and non-finalised. Include the window as parameter in the
close signal of the session.
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | src/ephy-encoding-menu.c | 4 | ||||
-rw-r--r-- | src/ephy-tabs-menu.c | 2 | ||||
-rw-r--r-- | src/ephy-window.c | 31 | ||||
-rw-r--r-- | src/session.c | 13 | ||||
-rw-r--r-- | src/session.h | 3 |
6 files changed, 51 insertions, 21 deletions
@@ -1,3 +1,22 @@ +2003-08-02 Christian Persch + + * src/ephy-encodings-menu.c: (build_group): + + Fix ui xml string. + + * src/ephy-tabs-menu.c: (ephy_tabs_menu_update): + + Fix mem leak. + + * src/ephy-window.c: (remove_from_session), (ephy_window_destroy), + (ephy_window_finalize): + * src/session.h: + * src/session.c: (session_class_init), (session_remove_window): + + Move up the removal of the window from the session to when it's still + valid and non-finalised. Include the window as parameter in the + close signal of the session. + 2003-08-02 Marco Pesenti Gritti <marco@it.gnome.org> * src/bookmarks/ephy-bookmarks-menu.c: diff --git a/src/ephy-encoding-menu.c b/src/ephy-encoding-menu.c index a664d5838..9aa03e84a 100644 --- a/src/ephy-encoding-menu.c +++ b/src/ephy-encoding-menu.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 Ricardo Fernández Pascual + * Copyright (C) 2002 Ricardo Fernández Pascual * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -221,7 +221,7 @@ build_group (EggActionGroup *action_group, egg_action_group_add_action (action_group, action); g_object_unref (action); - tmp = g_strdup_printf ("<submenu name=\"%sItem\" name=\"%s\">\n", + tmp = g_strdup_printf ("<submenu name=\"%sItem\" verb=\"%s\">\n", verb, verb); xml_string = g_string_append (xml_string, tmp); g_free (tmp); diff --git a/src/ephy-tabs-menu.c b/src/ephy-tabs-menu.c index 67c855d2c..c0339c897 100644 --- a/src/ephy-tabs-menu.c +++ b/src/ephy-tabs-menu.c @@ -304,6 +304,8 @@ ephy_tabs_menu_update (EphyTabsMenu *menu) ++i; } + g_list_free (tabs); + g_string_append (xml, "</placeholder></submenu></menu></Root>"); egg_menu_merge_insert_action_group (merge, p->action_group, 0); diff --git a/src/ephy-window.c b/src/ephy-window.c index 1f58e3bb3..8195b3135 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -332,13 +332,29 @@ ephy_window_get_type (void) } static void +remove_from_session (EphyWindow *window) +{ + Session *session; + + session = SESSION (ephy_shell_get_session (ephy_shell)); + g_return_if_fail (session != NULL); + + session_remove_window (session, window); +} + +static void ephy_window_destroy (GtkObject *gtkobject) { EphyWindow *window = EPHY_WINDOW (gtkobject); LOG ("EphyWindow destroy %p", window) - window->priv->closing = TRUE; + if (window->priv->closing == FALSE) + { + window->priv->closing = TRUE; + + remove_from_session (window); + } if (window->priv->exit_fullscreen_popup) { @@ -1435,17 +1451,6 @@ save_window_chrome (EphyWindow *window) } static void -remove_from_session (EphyWindow *window) -{ - Session *session; - - session = SESSION (ephy_shell_get_session (ephy_shell)); - g_return_if_fail (session != NULL); - - session_remove_window (session, window); -} - -static void ephy_window_finalize (GObject *object) { EphyWindow *window; @@ -1456,8 +1461,6 @@ ephy_window_finalize (GObject *object) g_return_if_fail (window->priv != NULL); - remove_from_session (window); - if (window->priv->find_dialog) { g_object_unref (G_OBJECT (window->priv->find_dialog)); diff --git a/src/session.c b/src/session.c index 4f1c8e8d5..7718586b3 100644 --- a/src/session.c +++ b/src/session.c @@ -133,9 +133,10 @@ session_class_init (SessionClass *klass) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (SessionClass, close_window), NULL, NULL, - g_cclosure_marshal_VOID__VOID, + g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, - 0); + 1, + G_TYPE_OBJECT); } static char * @@ -681,11 +682,15 @@ void session_remove_window (Session *session, EphyWindow *window) { + g_object_ref (window); + + session->priv->windows = g_list_remove (session->priv->windows, window); + g_signal_emit (G_OBJECT (session), session_signals[CLOSE_WINDOW], - 0); + 0, window); - session->priv->windows = g_list_remove (session->priv->windows, window); + g_object_unref (window); /* autodestroy of the session, necessay to avoid * conflicts with the nautilus view */ diff --git a/src/session.h b/src/session.h index 98c4f207b..9cba42628 100644 --- a/src/session.h +++ b/src/session.h @@ -52,7 +52,8 @@ struct SessionClass void ( *new_window) (Session *session, EphyWindow *window); - void ( *close_window) (Session *session); + void ( *close_window) (Session *session, + EphyWindow *window); }; GType session_get_type (void); |