From dd90d178cc3d0e4832ff0d728cfdc8f5b9076700 Mon Sep 17 00:00:00 2001 From: Allin Cottrell Date: Tue, 23 Feb 2016 10:01:24 -0800 Subject: [PATCH] Fix Quartz Full Screen Crash. --- gdk/quartz/GdkQuartzView.c | 2 +- gdk/quartz/GdkQuartzWindow.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c index 881c5cb8f7..368e040ecd 100644 --- a/gdk/quartz/GdkQuartzView.c +++ b/gdk/quartz/GdkQuartzView.c @@ -684,7 +684,7 @@ GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl); NSRect rect; - if (!impl->toplevel) + if (!impl || !impl->toplevel) return; if (trackingRect) diff --git a/gdk/quartz/GdkQuartzWindow.c b/gdk/quartz/GdkQuartzWindow.c index bcd934e20d..7aab759bd4 100644 --- a/gdk/quartz/GdkQuartzWindow.c +++ b/gdk/quartz/GdkQuartzWindow.c @@ -24,6 +24,14 @@ @implementation GdkQuartzWindow +- (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];