diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-01-04 17:06:10 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-01-04 17:06:10 +0100 |
| commit | 38b8dfaaea55d20f7209199638dd44fe0161add2 (patch) | |
| tree | 659aa6ad72b67d176369f8b50e17b451081492a6 /src | |
| parent | 2575e7ef6b7c49a8a660efa6eaaaa974b2295931 (diff) | |
Remove [FLViewLayer dealloc] method.
The Apple doc recommends not to release resources in an object's dealloc method.
The job is now done in the [FLWindow close] method.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 34fb7ba44..5bfeb390d 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -597,7 +597,6 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop() - (void)prepare_bitmap_for_layer; - (void)viewFrameDidChange; - (BOOL)wantsLayer; -- (void)dealloc; - (BOOL)did_view_resolution_change; - (void)drawRect:(NSRect)rect; @end @@ -610,6 +609,13 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop() // 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]; + CGContextRelease(view->layer_data); + view->layer_data = NULL; + } +#endif } #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 - (NSPoint)convertBaseToScreen:(NSPoint)aPoint @@ -2302,10 +2308,6 @@ static FLTextInputContext* fltextinputcontext_instance = nil; CGContextRelease(layer_data); layer_data = NULL; } --(void)dealloc { - CGContextRelease(layer_data); - [super dealloc]; -} - (void)drawRect:(NSRect)rect {} // necessary under 10.14.2 to support gl_start() @end #endif //>= MAC_OS_X_VERSION_10_8 |
