From bc28c27d07ae56467c45666ba6595901a99eadbe Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 2 Oct 2005 22:04:54 +0000 Subject: Fix memory leak. 2005-10-03 Christian Persch * src/ephy-window.c: (setup_ui_manager), (ephy_window_dispose), (ephy_window_finalize): Fix memory leak. --- src/ephy-window.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ephy-window.c b/src/ephy-window.c index 3716b32ed..04fa156b9 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1127,6 +1127,8 @@ setup_ui_manager (EphyWindow *window) window); gtk_ui_manager_insert_action_group (manager, action_group, 0); window->priv->action_group = action_group; + g_object_unref (action_group); + action = gtk_action_group_get_action (action_group, "FileOpen"); g_object_set (action, "short_label", _("Open"), NULL); action = gtk_action_group_get_action (action_group, "FileSaveAs"); @@ -1154,6 +1156,7 @@ setup_ui_manager (EphyWindow *window) G_N_ELEMENTS (ephy_popups_entries), window); gtk_ui_manager_insert_action_group (manager, action_group, 0); window->priv->popups_action_group = action_group; + g_object_unref (action_group); window->priv->manager = manager; g_signal_connect (manager, "add_widget", G_CALLBACK (add_widget), window); @@ -2508,6 +2511,8 @@ ephy_window_dispose (GObject *object) eel_gconf_notification_remove (priv->browse_with_caret_notifier_id); eel_gconf_notification_remove (priv->allow_popups_notifier_id); + priv->browse_with_caret_notifier_id = 0; + priv->allow_popups_notifier_id = 0; if (priv->idle_resize_handler != 0) { @@ -2534,9 +2539,9 @@ ephy_window_dispose (GObject *object) g_object_unref (priv->ppview_toolbar); priv->ppview_toolbar = NULL; } - - g_object_unref (priv->action_group); + priv->action_group = NULL; + priv->popups_action_group = NULL; g_object_unref (priv->manager); priv->manager = NULL; @@ -3042,7 +3047,7 @@ ephy_window_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); - LOG ("Ephy Window finalized %p", object); + LOG ("EphyWindow finalised %p", object); #ifdef ENABLE_PYTHON ephy_python_schedule_gc (); -- cgit v1.2.3