From 79400fff79976294cb92b3c47e696baac58491a5 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 14 Dec 2003 17:26:32 +0000 Subject: Fix mem leaks. Fix a crash when finalizing a nautilus view after having 2003-12-14 Christian Persch * src/ephy-nautilus-view.c: (ephy_nautilus_view_finalize), (gnv_cmd_select_encoding), (gnv_cmd_file_print), (gnv_cmd_edit_find): Fix mem leaks. Fix a crash when finalizing a nautilus view after having used the find dialogue. --- src/ephy-nautilus-view.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ephy-nautilus-view.c b/src/ephy-nautilus-view.c index 191e9fccb..7a05e0b91 100644 --- a/src/ephy-nautilus-view.c +++ b/src/ephy-nautilus-view.c @@ -280,6 +280,8 @@ ephy_nautilus_view_finalize (GObject *object) if (p->find_dialog) { + g_object_remove_weak_pointer (G_OBJECT (p->find_dialog), + (gpointer *) &p->find_dialog); g_object_unref (p->find_dialog); } @@ -531,7 +533,8 @@ gnv_cmd_select_encoding (BonoboUIComponent *uic, NULL)); ephy_dialog_set_modal (dialog, TRUE); - ephy_dialog_show (dialog); + ephy_dialog_run (dialog); + g_object_unref (dialog); } static void @@ -545,7 +548,8 @@ gnv_cmd_file_print (BonoboUIComponent *uic, dialog = ephy_print_dialog_new (NULL, p->embed, FALSE); ephy_dialog_set_modal (dialog, TRUE); - ephy_dialog_show (dialog); + ephy_dialog_run (dialog); + g_object_unref (dialog); } static void @@ -555,9 +559,11 @@ gnv_cmd_edit_find (BonoboUIComponent *uic, { EphyNautilusViewPrivate *p = view->priv; - if (!p->find_dialog) + if (p->find_dialog == NULL) { p->find_dialog = find_dialog_new (p->embed); + g_object_add_weak_pointer (G_OBJECT (p->find_dialog), + (gpointer *) &p->find_dialog); } ephy_dialog_show (p->find_dialog); -- cgit v1.2.3