diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-10-31 05:57:15 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-10-31 05:57:15 +0800 |
commit | 8ab23573e7476045751de8b3c2a5e31656234a85 (patch) | |
tree | 17a3a93f728433e605868b99f4f01661d349f32d /shell | |
parent | 3599e4885594487ccd440950d2f92099c873cf4c (diff) | |
download | gsoc2013-evolution-8ab23573e7476045751de8b3c2a5e31656234a85.tar gsoc2013-evolution-8ab23573e7476045751de8b3c2a5e31656234a85.tar.gz gsoc2013-evolution-8ab23573e7476045751de8b3c2a5e31656234a85.tar.bz2 gsoc2013-evolution-8ab23573e7476045751de8b3c2a5e31656234a85.tar.lz gsoc2013-evolution-8ab23573e7476045751de8b3c2a5e31656234a85.tar.xz gsoc2013-evolution-8ab23573e7476045751de8b3c2a5e31656234a85.tar.zst gsoc2013-evolution-8ab23573e7476045751de8b3c2a5e31656234a85.zip |
New. (class_init): Install it. (impl_unsetOwner): Just emit the
* evolution-shell-component.c (impl_owner_unset): New.
(class_init): Install it.
(impl_unsetOwner): Just emit the "owner_unset" signal as the
default implementation for that signal does all the work now.
(impl_owner_died): Set the owner_client to %NULL before unreffing
it.
(destroy): Likewise.
(impl_owner_unset): Likewise.
svn path=/trunk/; revision=14484
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 11 | ||||
-rw-r--r-- | shell/evolution-shell-component.c | 50 |
2 files changed, 48 insertions, 13 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index bc51e17655..75d2d825c5 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,16 @@ 2001-10-30 Ettore Perazzoli <ettore@ximian.com> + * evolution-shell-component.c (impl_owner_unset): New. + (class_init): Install it. + (impl_unsetOwner): Just emit the "owner_unset" signal as the + default implementation for that signal does all the work now. + (impl_owner_died): Set the owner_client to %NULL before unreffing + it. + (destroy): Likewise. + (impl_owner_unset): Likewise. + +2001-10-30 Ettore Perazzoli <ettore@ximian.com> + * e-shell-view.c (e_shell_view_construct): Connect to the "removed_folder" signal with gtk_signal_connect_while_alive() so we don't crash if the view gets destroyed. Fixes #13285. diff --git a/shell/evolution-shell-component.c b/shell/evolution-shell-component.c index 296ffe396c..37971be54e 100644 --- a/shell/evolution-shell-component.c +++ b/shell/evolution-shell-component.c @@ -194,8 +194,14 @@ owner_ping_callback (void *data) if (alive) return TRUE; - g_print ("\t*** The shell has disappeared\n"); - gtk_signal_emit (GTK_OBJECT (shell_component), signals[OWNER_DIED]); + /* This is tricky. During the pinging, we might have gotten an + ::unsetOwner invocation which has invalidated our owner_client. In + this case, no "owner_died" should be emitted. */ + + if (priv->owner_client != NULL) { + g_print ("\t*** The shell has disappeared\n"); + gtk_signal_emit (GTK_OBJECT (shell_component), signals[OWNER_DIED]); + } priv->ping_timeout_id = -1; @@ -403,14 +409,6 @@ impl_unsetOwner (PortableServer_Servant servant, return; } - if (priv->ping_timeout_id != -1) { - g_source_remove (priv->ping_timeout_id); - priv->ping_timeout_id = -1; - } - - bonobo_object_unref (BONOBO_OBJECT (priv->owner_client)); - priv->owner_client = NULL; - gtk_signal_emit (GTK_OBJECT (shell_component), signals[OWNER_UNSET]); } @@ -658,8 +656,13 @@ destroy (GtkObject *object) CORBA_exception_init (&ev); - if (priv->owner_client != NULL) - bonobo_object_unref (BONOBO_OBJECT (priv->owner_client)); + if (priv->owner_client != NULL) { + BonoboObject *owner_client_object; + + owner_client_object = BONOBO_OBJECT (priv->owner_client); + priv->owner_client = NULL; + bonobo_object_unref (BONOBO_OBJECT (owner_client_object)); + } CORBA_exception_free (&ev); @@ -692,14 +695,34 @@ destroy (GtkObject *object) /* EvolutionShellComponent methods. */ static void +impl_owner_unset (EvolutionShellComponent *shell_component) +{ + EvolutionShellComponentPrivate *priv; + BonoboObject *owner_client_object; + + priv = shell_component->priv; + + if (priv->ping_timeout_id != -1) { + g_source_remove (priv->ping_timeout_id); + priv->ping_timeout_id = -1; + } + + owner_client_object = BONOBO_OBJECT (priv->owner_client); + priv->owner_client = NULL; + bonobo_object_unref (BONOBO_OBJECT (owner_client_object)); +} + +static void impl_owner_died (EvolutionShellComponent *shell_component) { EvolutionShellComponentPrivate *priv; + BonoboObject *owner_client_object; priv = shell_component->priv; - bonobo_object_unref (BONOBO_OBJECT (priv->owner_client)); + owner_client_object = BONOBO_OBJECT (priv->owner_client); priv->owner_client = NULL; + bonobo_object_unref (BONOBO_OBJECT (owner_client_object)); /* The default implementation for ::owner_died emits ::owner_unset, so that we make the behavior for old components kind of correct without @@ -805,6 +828,7 @@ class_init (EvolutionShellComponentClass *klass) shell_component_class = EVOLUTION_SHELL_COMPONENT_CLASS (object_class); shell_component_class->owner_died = impl_owner_died; + shell_component_class->owner_unset = impl_owner_unset; } static void |