diff options
author | JP Rosevear <jpr@ximian.com> | 2003-05-15 02:39:22 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2003-05-15 02:39:22 +0800 |
commit | 74ee7fe6ae45bd9b498bb926aa0be181f68c48f2 (patch) | |
tree | 587e5958bcfcc5fc5b3957339b8a629b8e6132f0 /shell/e-shell-view.c | |
parent | 6e8895d6e8761cb44dbc15aa70f3304220727239 (diff) | |
download | gsoc2013-evolution-74ee7fe6ae45bd9b498bb926aa0be181f68c48f2.tar gsoc2013-evolution-74ee7fe6ae45bd9b498bb926aa0be181f68c48f2.tar.gz gsoc2013-evolution-74ee7fe6ae45bd9b498bb926aa0be181f68c48f2.tar.bz2 gsoc2013-evolution-74ee7fe6ae45bd9b498bb926aa0be181f68c48f2.tar.lz gsoc2013-evolution-74ee7fe6ae45bd9b498bb926aa0be181f68c48f2.tar.xz gsoc2013-evolution-74ee7fe6ae45bd9b498bb926aa0be181f68c48f2.tar.zst gsoc2013-evolution-74ee7fe6ae45bd9b498bb926aa0be181f68c48f2.zip |
release the interface if we got it
2003-05-14 JP Rosevear <jpr@ximian.com>
* e-shell.c (save_settings_for_component): release the interface
if we got it
* e-shell-view.c: include bonobo-exception.h
(impl_dispose): release and unref the shell view corba interface
(init): init to CORBA_OBJECT_NIL
(e_shell_view_get_corba_interface): return the corba interface
(setup_corba_interface): release the existing shell view, add as
an interface and then query to get it back
(get_view_for_uri): release and unref the control once we create
the widget with it
* e-corba-storage.c (storage_listener_servant_new): don't ref
ourselves
(storage_listener_servant_free): don't unref ourselves
(impl_dispose): free the servant info
* e-corba-storage-registry.c
(impl_StorageRegistry_getStorageByName): we need to ref as well as
duplicate since we didn't create the storage here
svn path=/trunk/; revision=21176
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r-- | shell/e-shell-view.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 081e3d32a3..ccbcffa5ce 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -66,6 +66,7 @@ #include <gtk/gtkscrolledwindow.h> #include <gconf/gconf-client.h> +#include <bonobo/bonobo-exception.h> #include <bonobo/bonobo-socket.h> #include <bonobo/bonobo-ui-util.h> #include <bonobo/bonobo-ui-container.h> @@ -91,7 +92,7 @@ struct _EShellViewPrivate { /* EvolutionShellView Bonobo object for implementing the Evolution::ShellView interface. */ - EvolutionShellView *corba_interface; + GNOME_Evolution_ShellView corba_interface; /* The UI handler & container. */ BonoboUIComponent *ui_component; @@ -1464,9 +1465,9 @@ impl_dispose (GObject *object) priv->shell = NULL; } - if (priv->corba_interface != NULL) { - bonobo_object_unref (BONOBO_OBJECT (priv->corba_interface)); - priv->corba_interface = NULL; + if (priv->corba_interface != CORBA_OBJECT_NIL) { + bonobo_object_release_unref (priv->corba_interface, NULL); + priv->corba_interface = CORBA_OBJECT_NIL; } if (priv->folder_bar_popup != NULL) { @@ -1582,7 +1583,7 @@ init (EShellView *shell_view) priv = g_new (EShellViewPrivate, 1); priv->shell = NULL; - priv->corba_interface = NULL; + priv->corba_interface = CORBA_OBJECT_NIL; priv->ui_component = NULL; priv->history = e_history_new ((EHistoryItemFreeFunc) g_free); priv->uri = NULL; @@ -1900,7 +1901,7 @@ e_shell_view_get_corba_interface (EShellView *shell_view) priv = shell_view->priv; - return bonobo_object_corba_objref (BONOBO_OBJECT (priv->corba_interface)); + return priv->corba_interface; } @@ -2167,7 +2168,8 @@ setup_corba_interface (EShellView *shell_view, EShellViewPrivate *priv; BonoboControlFrame *control_frame; EvolutionShellView *corba_interface; - + CORBA_Environment ev; + g_return_if_fail (control != NULL); priv = shell_view->priv; @@ -2191,8 +2193,18 @@ setup_corba_interface (EShellView *shell_view, bonobo_object_add_interface (BONOBO_OBJECT (control_frame), BONOBO_OBJECT (corba_interface)); - bonobo_object_ref (BONOBO_OBJECT (corba_interface)); - priv->corba_interface = corba_interface; + + /* Get rid of the existing one first */ + bonobo_object_release_unref (priv->corba_interface, NULL); + + /* Now find the existing one */ + CORBA_exception_init (&ev); + priv->corba_interface = Bonobo_Unknown_queryInterface (BONOBO_OBJREF (control_frame), + "IDL:GNOME/Evolution/ShellView:1.0", + &ev); + if (BONOBO_EX (&ev)) + priv->corba_interface = CORBA_OBJECT_NIL; + CORBA_exception_free (&ev); } @@ -2339,6 +2351,7 @@ get_view_for_uri (EShellView *shell_view, container = bonobo_ui_component_get_container (priv->ui_component); control = bonobo_widget_new_control_from_objref (corba_control, container); + bonobo_object_release_unref (corba_control, NULL); socket = find_socket (GTK_CONTAINER (control)); destroy_connection_id = g_signal_connect (socket, "destroy", |