From 2bc7816cab0b4a7f4cd88fe45829d901db6b04a9 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 4 Jan 2019 17:50:58 +0100 Subject: Slight reorganization of the [FLWindow close] method. It might be safer to use the window's contentView before sending the close message to the window. --- src/Fl_cocoa.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 5bfeb390d..f8d84ef36 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -605,10 +605,6 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop() @implementation FLWindow - (void)close { - [super close]; - // when a fullscreen window is closed, windowDidResize may be sent after the close message was sent - // and before the FLWindow receives the final dealloc message - w = NULL; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 if ([[self contentView] isMemberOfClass:[FLViewLayer class]]) { FLViewLayer *view = (FLViewLayer*)[self contentView]; @@ -616,6 +612,10 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop() view->layer_data = NULL; } #endif + [super close]; + // when a fullscreen window is closed, windowDidResize may be sent after the close message was sent + // and before the FLWindow receives the final dealloc message + w = NULL; } #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 - (NSPoint)convertBaseToScreen:(NSPoint)aPoint -- cgit v1.2.3