From c2afd80bd66b56db0e6a76f4289a76434a53d445 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 7 Jul 2000 17:54:25 +0000 Subject: Add an extra ref for the CORBA storage BonoboObject so that the number of refs and unrefs matches again. svn path=/trunk/; revision=3951 --- shell/ChangeLog | 5 +++++ shell/e-shell.c | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 27fda3f519..8653729d40 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,8 @@ +2000-07-07 Ettore Perazzoli + + * e-shell.c (setup_corba_storages): Ref the CORBA storage + registry. + 2000-07-06 Ettore Perazzoli * evolution-storage.c: Removed `corba_storage_registry' member diff --git a/shell/e-shell.c b/shell/e-shell.c index d767707c38..8a262b4a8a 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -258,17 +258,23 @@ static gboolean setup_corba_storages (EShell *shell) { EShellPrivate *priv; + ECorbaStorageRegistry *corba_storage_registry; priv = shell->priv; g_assert (priv->storage_set != NULL); - priv->corba_storage_registry = e_corba_storage_registry_new (priv->storage_set); + corba_storage_registry = e_corba_storage_registry_new (priv->storage_set); - if (priv->corba_storage_registry == NULL) + if (corba_storage_registry == NULL) return FALSE; - bonobo_object_add_interface (BONOBO_OBJECT (shell), - BONOBO_OBJECT (priv->corba_storage_registry)); + bonobo_object_add_interface (BONOBO_OBJECT (shell), BONOBO_OBJECT (corba_storage_registry)); + + /* Notice that `bonobo_object_add_interface()' aggregates the two object's + reference counts, so we need an extra ref here if we want to keep a separate + pointer to the storage interface. */ + bonobo_object_ref (BONOBO_OBJECT (corba_storage_registry)); + priv->corba_storage_registry = corba_storage_registry; return TRUE; } -- cgit v1.2.3