GtkApplication: avoid a crash
authorMatthias Clasen <mclasen@redhat.com>
Wed, 8 Apr 2015 19:44:21 +0000 (15:44 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 8 Apr 2015 19:44:21 +0000 (15:44 -0400)
It can apparently happen that we get focus in events
on windows after gtk_application_shutdown() has been
called. Avoid an unnecessary crash in this case.

See
https://bugzilla.redhat.com/show_bug.cgi?id=1176339

gtk/gtkapplication.c

index 80658c59c2acd434d5d5cf76b2d30a3b05485f46..91ef3559cf6572391309281e80bbb1734bdc15a3 100644 (file)
@@ -506,7 +506,9 @@ gtk_application_focus_in_event_cb (GtkWindow      *window,
       priv->windows = g_list_concat (link, priv->windows);
     }
 
-  gtk_application_impl_active_window_changed (application->priv->impl, window);
+  if (application->priv->impl)
+    gtk_application_impl_active_window_changed (application->priv->impl, window);
+
   g_object_notify (G_OBJECT (application), "active-window");
 
   return FALSE;