[gtk+] application: Be save against impl being NULL



commit aff6835f1b854dfda1934e843d46a569c549c78c
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Sep 23 14:35:58 2015 -0400

    application: Be save against impl being NULL
    
    We clear the impl in shutdown, so all callbacks that may
    happen at a later time need to be prepared for this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=755432

 gtk/gtkapplication.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index af13451..ba7ef7b 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -723,7 +723,8 @@ gtk_application_window_removed (GtkApplication *application,
 
   old_active = priv->windows;
 
-  gtk_application_impl_window_removed (application->priv->impl, window);
+  if (priv->impl)
+    gtk_application_impl_window_removed (priv->impl, window);
 
   g_signal_handlers_disconnect_by_func (window,
                                         gtk_application_focus_in_event_cb,
@@ -733,9 +734,9 @@ gtk_application_window_removed (GtkApplication *application,
   priv->windows = g_list_remove (priv->windows, window);
   gtk_window_set_application (window, NULL);
 
-  if (priv->windows != old_active)
+  if (priv->windows != old_active && priv->impl)
     {
-      gtk_application_impl_active_window_changed (application->priv->impl, priv->windows ? 
priv->windows->data : NULL);
+      gtk_application_impl_active_window_changed (priv->impl, priv->windows ? priv->windows->data : NULL);
       g_object_notify_by_pspec (G_OBJECT (application), gtk_application_props[PROP_ACTIVE_WINDOW]);
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]