[gnome-shell] systray: Bail out if the plug window is gone



commit 0b6c5b462012d212df6b25b2d3a2002bbb22f428
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed Sep 7 13:25:24 2016 +0200

    systray: Bail out if the plug window is gone
    
    Instead of crashing when deferencing a NULL pointer.
    
    Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=755313

 src/shell-tray-icon.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/shell-tray-icon.c b/src/shell-tray-icon.c
index 2397117..e80dd3e 100644
--- a/src/shell-tray-icon.c
+++ b/src/shell-tray-icon.c
@@ -204,6 +204,12 @@ shell_tray_icon_click (ShellTrayIcon *icon,
   gdk_error_trap_push ();
 
   remote_window = gtk_socket_get_plug_window (GTK_SOCKET (icon->priv->socket));
+  if (remote_window == NULL)
+    {
+      g_warning ("shell tray: plug window is gone");
+      gdk_error_trap_pop_ignored ();
+      return;
+    }
   xwindow = GDK_WINDOW_XID (remote_window);
   xdisplay = GDK_WINDOW_XDISPLAY (remote_window);
   screen = gdk_window_get_screen (remote_window);


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