From 060e43e79b6886b05e568e36af6d865403ba26c1 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Mon, 25 Jun 2001 06:36:22 +0000 Subject: Fixed a nasty chain of broken fixes to broken fixes to broken fixes, thus getting the shell refcounting in better shape. The quit sequence is still not quite right, but we are getting there. Also fixed a nasty bug in destroying the EStorageSet due to a very old commit by the Meekster. svn path=/trunk/; revision=10470 --- shell/e-shell.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'shell/e-shell.c') diff --git a/shell/e-shell.c b/shell/e-shell.c index c642d991c6..595be5d55c 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -77,10 +77,10 @@ struct _EShellPrivate { EComponentRegistry *component_registry; - ECorbaStorageRegistry *corba_storage_registry; + ECorbaStorageRegistry *corba_storage_registry; /* */ /* ::Activity interface handler. */ - EActivityHandler *activity_handler; + EActivityHandler *activity_handler; /* */ /* This object handles going off-line. If the pointer is not NULL, it means we have a going-off-line process in progress. */ @@ -326,8 +326,6 @@ setup_activity_interface (EShell *shell) bonobo_object_add_interface (BONOBO_OBJECT (shell), BONOBO_OBJECT (activity_handler)); - - bonobo_object_ref (BONOBO_OBJECT (activity_handler)); priv->activity_handler = activity_handler; } @@ -351,10 +349,6 @@ setup_corba_storages (EShell *shell) 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; @@ -548,10 +542,9 @@ view_destroy_cb (GtkObject *object, shell->priv->views = g_list_remove (shell->priv->views, object); if (shell->priv->views == NULL) { - /* FIXME: This looks like a Bonobo bug to me. */ - bonobo_object_ref (BONOBO_OBJECT (shell)); + /* bonobo_object_ref (BONOBO_OBJECT (shell)); */ gtk_signal_emit (GTK_OBJECT (shell), signals [NO_VIEWS_LEFT]); - bonobo_object_unref (BONOBO_OBJECT (shell)); + /* bonobo_object_unref (BONOBO_OBJECT (shell)); */ } } @@ -605,11 +598,9 @@ destroy (GtkObject *object) g_list_free (priv->views); - if (priv->corba_storage_registry != NULL) - bonobo_object_unref (BONOBO_OBJECT (priv->corba_storage_registry)); - - if (priv->activity_handler != NULL) - bonobo_object_unref (BONOBO_OBJECT (priv->activity_handler)); + /* No unreffing for these as they are aggregate. */ + /* bonobo_object_unref (BONOBO_OBJECT (priv->corba_storage_registry)); */ + /* bonobo_object_unref (BONOBO_OBJECT (priv->activity_handler)); */ /* FIXME. Maybe we should do something special here. */ if (priv->offline_handler != NULL) -- cgit