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
This commit is contained in:
@ -620,8 +620,7 @@ gtk_application_startup (GApplication *g_application)
|
|||||||
{
|
{
|
||||||
GtkApplication *application = GTK_APPLICATION (g_application);
|
GtkApplication *application = GTK_APPLICATION (g_application);
|
||||||
|
|
||||||
G_APPLICATION_CLASS (gtk_application_parent_class)
|
G_APPLICATION_CLASS (gtk_application_parent_class)->startup (g_application);
|
||||||
->startup (g_application);
|
|
||||||
|
|
||||||
gtk_action_muxer_insert (application->priv->muxer, "app", G_ACTION_GROUP (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);
|
GtkApplication *application = GTK_APPLICATION (g_application);
|
||||||
|
|
||||||
|
if (application->priv->impl == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
gtk_application_impl_shutdown (application->priv->impl);
|
gtk_application_impl_shutdown (application->priv->impl);
|
||||||
g_clear_object (&application->priv->impl);
|
g_clear_object (&application->priv->impl);
|
||||||
|
|
||||||
@ -651,8 +653,7 @@ gtk_application_shutdown (GApplication *g_application)
|
|||||||
/* Synchronize the recent manager singleton */
|
/* Synchronize the recent manager singleton */
|
||||||
_gtk_recent_manager_sync ();
|
_gtk_recent_manager_sync ();
|
||||||
|
|
||||||
G_APPLICATION_CLASS (gtk_application_parent_class)
|
G_APPLICATION_CLASS (gtk_application_parent_class)->shutdown (g_application);
|
||||||
->shutdown (g_application);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|||||||
Reference in New Issue
Block a user