Blame SOURCES/0001-display-Check-we-have-a-screen-before-freeing-it.patch

db633a
From 91dced2ea5e4317c0067df28071c7694fb2f35ac Mon Sep 17 00:00:00 2001
db633a
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
db633a
Date: Fri, 17 Feb 2017 14:24:38 +0100
db633a
Subject: [PATCH] display: Check we have a screen before freeing it
db633a
db633a
The reason for the display to be closed may be meta_screen_new()
db633a
returning NULL, in which case we don't have a screen to free.
db633a
Avoid a segfault on exit by adding a proper check.
db633a
db633a
https://bugzilla.gnome.org/show_bug.cgi?id=778831
db633a
---
db633a
 src/core/display.c | 4 +++-
db633a
 1 file changed, 3 insertions(+), 1 deletion(-)
db633a
db633a
diff --git a/src/core/display.c b/src/core/display.c
db633a
index 42a530f6c..c6248ce34 100644
db633a
--- a/src/core/display.c
db633a
+++ b/src/core/display.c
db633a
@@ -1113,7 +1113,9 @@ meta_display_close (MetaDisplay *display,
db633a
   meta_display_free_events_x11 (display);
db633a
   meta_display_free_events (display);
db633a
 
db633a
-  meta_screen_free (display->screen, timestamp);
db633a
+  if (display->screen)
db633a
+    meta_screen_free (display->screen, timestamp);
db633a
+  display->screen = NULL;
db633a
 
db633a
   /* Must be after all calls to meta_window_unmanage() since they
db633a
    * unregister windows
db633a
-- 
db633a
2.12.0
db633a