Skip to content

Commit

Permalink
e_shell_quit() called twice at the end of application
Browse files Browse the repository at this point in the history
This could exhibit as a double-prompt whether wants to quit with
pending messages in Outbox, where the second prompt, the one with
the EShellWindow being destroyed, didn't make much sense.
  • Loading branch information
mcrha committed Mar 11, 2015
1 parent b0ebeeb commit 1628c20
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion shell/e-shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct _EShellPrivate {
guint network_available_locked : 1;
guint online : 1;
guint quit_cancelled : 1;
guint ready_to_quit : 1;
guint safe_mode : 1;
};

Expand Down Expand Up @@ -151,7 +152,8 @@ shell_window_removed_cb (EShell *shell)
{
g_return_if_fail (E_IS_SHELL (shell));

if (!gtk_application_get_windows (GTK_APPLICATION (shell)))
if (!gtk_application_get_windows (GTK_APPLICATION (shell)) &&
!shell->priv->ready_to_quit)
e_shell_quit (shell, E_SHELL_QUIT_LAST_WINDOW);
}

Expand Down Expand Up @@ -410,9 +412,13 @@ shell_ready_for_quit (EShell *shell,
GtkApplication *application;
GList *list;

g_return_if_fail (E_IS_SHELL (shell));

if (!is_last_ref)
return;

shell->priv->ready_to_quit = TRUE;

application = GTK_APPLICATION (shell);

/* Increment the reference count so we can safely emit
Expand Down

0 comments on commit 1628c20

Please sign in to comment.