diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 11 | ||||
-rw-r--r-- | mail/folder-browser.c | 8 |
3 files changed, 27 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 04252f2d55..0c8813036e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2000-04-07 Matt Loper <matt@helixcode.com> + + * folder-browser.c (folder_browser_destroy): Unref the shell + interface that we have a handle to. + + * folder-browser-factory.c (control_destroy_cb): New function; + destroys a folder-browser when its control is destroyed. + (folder_browser_factory): Hook up to the above. + 2000-04-07 Dan Winship <danw@helixcode.com> * mail-ops.c: new file, for toolbar/menu callbacks diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index 8e2b7ec8f7..a6075f7858 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -39,7 +39,7 @@ folder_browser_set_shell (EvolutionServiceRepository *sr, CORBA_exception_init (&ev); folder_browser = FOLDER_BROWSER (closure); - /* FIXME : ref the shell here */ + folder_browser->shell = shell; /* test the component->shell registration */ @@ -225,7 +225,14 @@ control_activate_cb (BonoboControl *control, control_deactivate (control, uih); } +static void +control_destroy_cb (BonoboControl *control, + gpointer user_data) +{ + GtkWidget *folder_browser = user_data; + gtk_object_destroy (GTK_OBJECT (folder_browser)); +} /* * Creates the Folder Browser, wraps it in a Bonobo Control, and @@ -264,6 +271,8 @@ folder_browser_factory (BonoboGenericFactory *factory, void *closure) gtk_signal_connect (GTK_OBJECT (control), "activate", control_activate_cb, NULL); + gtk_signal_connect (GTK_OBJECT (control), "destroy", + control_destroy_cb, folder_browser); bonobo_control_set_property_bag (control, FOLDER_BROWSER (folder_browser)->properties); diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 5b75fd189d..f4f32ba4b7 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -33,7 +33,15 @@ static void folder_browser_destroy (GtkObject *object) { FolderBrowser *folder_browser = FOLDER_BROWSER (object); + + if (folder_browser->shell) { + CORBA_Environment ev; + CORBA_exception_init (&ev); + Bonobo_Unknown_unref (folder_browser->shell, &ev); + CORBA_exception_free (&ev); + } + if (folder_browser->uri) g_free (folder_browser->uri); |