From 46d3611052060cfbba7cbcae7b8ec68a41f011dd Mon Sep 17 00:00:00 2001 From: Allin Cottrell Date: Sun, 21 Feb 2016 16:22:27 -0800 Subject: [PATCH] Fix Quartz Full Screen Crash. --- gdk/quartz/GdkQuartzNSWindow.c | 8 ++++++++ gdk/quartz/GdkQuartzView.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c index d485531d6e..e45c632aa8 100644 --- a/gdk/quartz/GdkQuartzNSWindow.c +++ b/gdk/quartz/GdkQuartzNSWindow.c @@ -23,6 +23,14 @@ @implementation GdkQuartzNSWindow +- (void)windowWillClose:(NSNotification*)notification +{ + // Clears the delegate when window is going to be closed; since EL + // Capitan it is possible that the methods of delegate would get + // called after the window has been closed. + [self setDelegate:nil]; +} + -(BOOL)windowShouldClose:(id)sender { GdkWindow *window = [[self contentView] gdkWindow]; diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c index cbd7fe5cbb..780b5a3473 100644 --- a/gdk/quartz/GdkQuartzView.c +++ b/gdk/quartz/GdkQuartzView.c @@ -662,7 +662,7 @@ GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (gdk_window->impl); NSRect rect; - if (!impl->toplevel) + if (!impl || !impl->toplevel) return; if (trackingRect)