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

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