From 4cec9fc7169dc3b810321555a70cda916720867d Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 20 Mar 2009 19:06:59 +0000 Subject: Saving progress on a massive attachment handling rewrite. svn path=/branches/kill-bonobo/; revision=37465 --- shell/e-shell.c | 14 ++++++++++++++ shell/main.c | 16 +++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'shell') diff --git a/shell/e-shell.c b/shell/e-shell.c index 6e52d8bbef..5de46bcc65 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -170,12 +170,19 @@ shell_ready_for_offline (EShell *shell, if (!is_last_ref) return; + /* Increment the reference count so we can safely emit + * a signal without triggering the toggle reference. */ + g_object_ref (activity); + e_activity_complete (activity); g_object_remove_toggle_ref ( G_OBJECT (activity), (GToggleNotify) shell_ready_for_offline, shell); + /* Finalize the activity. */ + g_object_unref (activity); + shell->priv->online = FALSE; g_object_notify (G_OBJECT (shell), "online"); @@ -217,12 +224,19 @@ shell_ready_for_online (EShell *shell, if (!is_last_ref) return; + /* Increment the reference count so we can safely emit + * a signal without triggering the toggle reference. */ + g_object_ref (activity); + e_activity_complete (activity); g_object_remove_toggle_ref ( G_OBJECT (activity), (GToggleNotify) shell_ready_for_online, shell); + /* Finalize the activity. */ + g_object_unref (activity); + shell->priv->online = TRUE; g_object_notify (G_OBJECT (shell), "online"); diff --git a/shell/main.c b/shell/main.c index 6b15768e07..bf0a8c47c6 100644 --- a/shell/main.c +++ b/shell/main.c @@ -618,13 +618,15 @@ create_default_shell (void) shell, "window-destroyed", G_CALLBACK (shell_window_destroyed_cb), NULL); - g_signal_connect ( - master_client, "save_yourself", - G_CALLBACK (master_client_save_yourself_cb), shell); - - g_signal_connect ( - master_client, "die", - G_CALLBACK (master_client_die_cb), shell); + if (master_client != NULL) { + g_signal_connect ( + master_client, "save_yourself", + G_CALLBACK (master_client_save_yourself_cb), shell); + + g_signal_connect ( + master_client, "die", + G_CALLBACK (master_client_die_cb), shell); + } g_object_unref (conf_client); -- cgit v1.2.3