[gtk+/gtk-2-24] Fix Quartz Full Screen Crash.



commit dd90d178cc3d0e4832ff0d728cfdc8f5b9076700
Author: Allin Cottrell <cottrell wfu edu>
Date:   Tue Feb 23 10:01:24 2016 -0800

    Fix Quartz Full Screen Crash.

 gdk/quartz/GdkQuartzView.c   |    2 +-
 gdk/quartz/GdkQuartzWindow.c |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c
index 881c5cb..368e040 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 bcd934e..7aab759 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];


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