aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-09-06 22:36:08 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-09-06 22:36:08 +0800
commit7d777d329b79bc9095c460b1c91d34ff7abefe48 (patch)
tree9cdeaa68303edeef5bd77684d68c6b9066b9eec3 /mail/folder-browser.c
parent51857b1153f08c6fb2dd3fbd4d36e63aeac385bb (diff)
downloadgsoc2013-evolution-7d777d329b79bc9095c460b1c91d34ff7abefe48.tar.gz
gsoc2013-evolution-7d777d329b79bc9095c460b1c91d34ff7abefe48.tar.zst
gsoc2013-evolution-7d777d329b79bc9095c460b1c91d34ff7abefe48.zip
Fix memory handling for the shell's CORBA object reference within the
folder browser. svn path=/trunk/; revision=5221
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index cbd74e002a..72d75af0d3 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -47,11 +47,15 @@ static void oc_destroy (gpointer obj, gpointer user)
static void
folder_browser_destroy (GtkObject *object)
{
- FolderBrowser *folder_browser = FOLDER_BROWSER (object);
+ FolderBrowser *folder_browser;
+ CORBA_Environment ev;
- /*if (folder_browser->shell)
- * CORBA_free (folder_browser->shell);
- */
+ folder_browser = FOLDER_BROWSER (object);
+
+ CORBA_exception_init (&ev);
+
+ if (folder_browser->shell != CORBA_OBJECT_NIL)
+ CORBA_Object_release (folder_browser->shell, &ev);
if (folder_browser->uri)
g_free (folder_browser->uri);
@@ -75,6 +79,8 @@ folder_browser_destroy (GtkObject *object)
g_slist_free (folder_browser->filter_menu_paths);
}
+ CORBA_exception_free (&ev);
+
folder_browser_parent_class->destroy (object);
}
@@ -458,15 +464,29 @@ my_folder_browser_init (GtkObject *object)
}
GtkWidget *
-folder_browser_new (Evolution_Shell shell)
+folder_browser_new (const Evolution_Shell shell)
{
- static int serial;
- FolderBrowser *folder_browser = gtk_type_new (folder_browser_get_type ());
+ static int serial = 0;
+ CORBA_Environment ev;
+ FolderBrowser *folder_browser;
+
+ CORBA_exception_init (&ev);
+
+ folder_browser = gtk_type_new (folder_browser_get_type ());
my_folder_browser_init (GTK_OBJECT (folder_browser));
folder_browser->uri = NULL;
folder_browser->serial = serial++;
- folder_browser->shell = shell;
+
+ folder_browser->shell = CORBA_Object_duplicate (shell, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ folder_browser->shell = CORBA_OBJECT_NIL;
+ gtk_widget_destroy (GTK_WIDGET (folder_browser));
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
return GTK_WIDGET (folder_browser);
}