GtkApplication: Prevent more crashes around shutdown
authorMatthias Clasen <mclasen@redhat.com>
Fri, 10 Apr 2015 12:03:24 +0000 (08:03 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 10 Apr 2015 12:04:53 +0000 (08:04 -0400)
gtk_application_shutdown clears the impl member, so all
callbacks, signal handlers, etc that might still be triggered
between a shutdown call and the return from the mainloop
better be prepared to deal with impl being NULL.

gtk/gtkapplication.c

index 91ef3559cf6572391309281e80bbb1734bdc15a3..cdc792d633fa68aeb52db0a7345e7fcf095aa7b0 100644 (file)
@@ -1780,14 +1780,16 @@ void
 gtk_application_handle_window_realize (GtkApplication *application,
                                        GtkWindow      *window)
 {
-  gtk_application_impl_handle_window_realize (application->priv->impl, window);
+  if (application->priv->impl)
+    gtk_application_impl_handle_window_realize (application->priv->impl, window);
 }
 
 void
 gtk_application_handle_window_map (GtkApplication *application,
                                    GtkWindow      *window)
 {
-  gtk_application_impl_handle_window_map (application->priv->impl, window);
+  if (application->priv->impl)
+    gtk_application_impl_handle_window_map (application->priv->impl, window);
 }
 
 /**