aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Loper <mloper@src.gnome.org>2000-04-08 05:42:56 +0800
committerMatthew Loper <mloper@src.gnome.org>2000-04-08 05:42:56 +0800
commit59606c28498271b7e0d3734f9b094bee3fc10cf8 (patch)
tree3a1394611fd756784d32449927ccede0d8af6d15
parentc893285da76dca4a43ace7819964f09ce8802882 (diff)
downloadgsoc2013-evolution-59606c28498271b7e0d3734f9b094bee3fc10cf8.tar.gz
gsoc2013-evolution-59606c28498271b7e0d3734f9b094bee3fc10cf8.tar.zst
gsoc2013-evolution-59606c28498271b7e0d3734f9b094bee3fc10cf8.zip
+ * 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. + + * e-shell-view.c (destroy_folder_view): New function; + Bonobo_Unknown_unref's the controls that have the views in them. + (esv_destroy): Calls the above for each folder_view in the + hashtable. + (get_view): unref the ServiceRepository interface of the control + when we're done with it. + svn path=/trunk/; revision=2333
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/folder-browser-factory.c11
-rw-r--r--mail/folder-browser.c8
-rw-r--r--shell/ChangeLog9
-rw-r--r--shell/e-shell-view.c47
5 files changed, 79 insertions, 5 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);
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 232cea4f49..9c8e753ee1 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,12 @@
+2000-04-07 Matt Loper <matt@helixcode.com>
+
+ * e-shell-view.c (destroy_folder_view): New function;
+ Bonobo_Unknown_unref's the controls that have the views in them.
+ (esv_destroy): Calls the above for each folder_view in the
+ hashtable.
+ (get_view): unref the ServiceRepository interface of the control
+ when we're done with it.
+
2000-04-06 Miguel de Icaza <miguel@gnu.org>
* shell/e-shortcut.c (shell_icon_cb): Append a slash here.
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 956401fbdc..ac9b97d98c 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -31,6 +31,38 @@ struct _EShellViewPrivate
GtkWidget *notebook;
};
+static void
+destroy_folder_view (EFolder *unused, GtkWidget *folder_view, gpointer unused2)
+{
+ BonoboWidget *bonobo_widget;
+ BonoboObject *bonobo_object;
+ CORBA_Object corba_control;
+ CORBA_Environment ev;
+
+ g_print ("%s: %s entered\n",
+ __FILE__, __FUNCTION__);
+
+ g_return_if_fail (BONOBO_IS_WIDGET (folder_view));
+
+ bonobo_widget = BONOBO_WIDGET (folder_view);
+
+ bonobo_object = BONOBO_OBJECT (
+ bonobo_widget_get_server (bonobo_widget));
+
+ corba_control = bonobo_object_corba_objref (bonobo_object);
+
+ g_return_if_fail (corba_control != NULL);
+
+ CORBA_exception_init (&ev);
+
+ /* hangs on this! */
+ Bonobo_Unknown_unref (corba_control, &ev);
+ CORBA_exception_free (&ev);
+
+ g_print ("%s: %s exited\n",
+ __FILE__, __FUNCTION__);
+}
+
static void
esv_destroy (GtkObject *object)
@@ -39,6 +71,9 @@ esv_destroy (GtkObject *object)
e_shell_unregister_view (eshell_view->eshell, eshell_view);
+ g_hash_table_foreach (eshell_view->priv->folder_views,
+ destroy_folder_view, NULL);
+
g_hash_table_destroy (eshell_view->priv->folder_views);
g_free (eshell_view->priv);
parent_class->destroy (object);
@@ -134,6 +169,8 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
Evolution_ServiceRepository corba_sr;
BonoboObjectClient *server =
bonobo_widget_get_server (BONOBO_WIDGET (w));
+ CORBA_Environment ev;
+ CORBA_exception_init (&ev);
/* Does this control have the "ServiceRepository" interface? */
corba_sr = (Evolution_ServiceRepository)
@@ -145,13 +182,13 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
/* If it does, pass our shell interface to it */
if (corba_sr != CORBA_OBJECT_NIL) {
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
Evolution_ServiceRepository_set_shell (corba_sr,
corba_shell,
&ev);
- CORBA_exception_free (&ev);
-
+ /* We're done with the service repository interface,
+ so now let's get rid of it */
+ Bonobo_Unknown_unref (corba_sr, &ev);
+
} else {
g_print ("The bonobo component for \"%s\" doesn't "
@@ -160,6 +197,8 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
e_folder_get_description (efolder));
}
+ CORBA_exception_free (&ev);
+
gtk_widget_show (w);
}