aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2003-05-15 02:39:22 +0800
committerJP Rosevear <jpr@src.gnome.org>2003-05-15 02:39:22 +0800
commit74ee7fe6ae45bd9b498bb926aa0be181f68c48f2 (patch)
tree587e5958bcfcc5fc5b3957339b8a629b8e6132f0 /shell
parent6e8895d6e8761cb44dbc15aa70f3304220727239 (diff)
downloadgsoc2013-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')
-rw-r--r--shell/ChangeLog22
-rw-r--r--shell/e-corba-storage-registry.c5
-rw-r--r--shell/e-corba-storage.c4
-rw-r--r--shell/e-shell-user-creatable-items-handler.c3
-rw-r--r--shell/e-shell-view.c31
-rw-r--r--shell/e-shell.c2
6 files changed, 52 insertions, 15 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 0ee2de2aab..2ea4e22322 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,25 @@
+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
+
2003-05-09 Jeremy Katz <katzj@redhat.com>
* main.c: Add a #include to fix a warning.
diff --git a/shell/e-corba-storage-registry.c b/shell/e-corba-storage-registry.c
index bfffdb6981..83f58c7079 100644
--- a/shell/e-corba-storage-registry.c
+++ b/shell/e-corba-storage-registry.c
@@ -193,10 +193,9 @@ impl_StorageRegistry_getStorageByName (PortableServer_Servant servant,
return CORBA_OBJECT_NIL;
}
- corba_storage = CORBA_Object_duplicate (e_corba_storage_get_corba_objref
- (E_CORBA_STORAGE (storage)), ev);
+ corba_storage = e_corba_storage_get_corba_objref (E_CORBA_STORAGE (storage));
- return corba_storage;
+ return bonobo_object_dup_ref (corba_storage, NULL);
}
static void
diff --git a/shell/e-corba-storage.c b/shell/e-corba-storage.c
index b7ab36c3f8..185b4093a9 100644
--- a/shell/e-corba-storage.c
+++ b/shell/e-corba-storage.c
@@ -77,7 +77,6 @@ storage_listener_servant_new (ECorbaStorage *corba_storage)
servant->servant.vepv = &storage_listener_vepv;
- g_object_ref (corba_storage);
servant->storage = E_STORAGE (corba_storage);
return servant;
@@ -86,8 +85,6 @@ storage_listener_servant_new (ECorbaStorage *corba_storage)
static void
storage_listener_servant_free (StorageListenerServant *servant)
{
- g_object_unref (servant->storage);
-
g_free (servant);
}
@@ -272,6 +269,7 @@ impl_dispose (GObject *object)
CORBA_free (object_id);
+ storage_listener_servant_free (priv->storage_listener_servant);
priv->storage_listener_servant = NULL;
}
diff --git a/shell/e-shell-user-creatable-items-handler.c b/shell/e-shell-user-creatable-items-handler.c
index efc1b24f5f..adf98cedb3 100644
--- a/shell/e-shell-user-creatable-items-handler.c
+++ b/shell/e-shell-user-creatable-items-handler.c
@@ -598,6 +598,8 @@ setup_toolbar_button (EShellUserCreatableItemsHandler *handler,
bonobo_ui_component_object_set (ui_component, "/Toolbar/NewComboButton",
BONOBO_OBJREF (control), NULL);
+ bonobo_object_unref (control);
+
g_object_set_data (G_OBJECT (shell_view), COMBO_BUTTON_WIDGET_KEY, combo_button);
tooltips = gtk_tooltips_new ();
@@ -679,6 +681,7 @@ impl_dispose (GObject *object)
g_slist_free (priv->components);
priv->components = NULL;
+
(* G_OBJECT_CLASS (parent_class)->dispose) (object);
}
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",
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 8985f42661..8b081c2052 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -1632,6 +1632,8 @@ save_settings_for_component (EShell *shell,
CORBA_exception_free (&ev);
+ bonobo_object_release_unref (session_interface, NULL);
+
return retval;
}