Commit 0049be4e authored by Matthias Clasen's avatar Matthias Clasen

application: Protect against double shutdown

It is not something that can happen normally.
But if it does, we shouldn't crash.

https://bugzilla.gnome.org/show_bug.cgi?id=760680
parent 2b95e4db
......@@ -620,8 +620,7 @@ gtk_application_startup (GApplication *g_application)
{
GtkApplication *application = GTK_APPLICATION (g_application);
G_APPLICATION_CLASS (gtk_application_parent_class)
->startup (g_application);
G_APPLICATION_CLASS (gtk_application_parent_class)->startup (g_application);
gtk_action_muxer_insert (application->priv->muxer, "app", G_ACTION_GROUP (application));
......@@ -638,6 +637,9 @@ gtk_application_shutdown (GApplication *g_application)
{
GtkApplication *application = GTK_APPLICATION (g_application);
if (application->priv->impl == NULL)
return;
gtk_application_impl_shutdown (application->priv->impl);
g_clear_object (&application->priv->impl);
......@@ -651,8 +653,7 @@ gtk_application_shutdown (GApplication *g_application)
/* Synchronize the recent manager singleton */
_gtk_recent_manager_sync ();
G_APPLICATION_CLASS (gtk_application_parent_class)
->shutdown (g_application);
G_APPLICATION_CLASS (gtk_application_parent_class)->shutdown (g_application);
}
static gboolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment