From b1cf40868d65306c9fe56e424c3173cec7769b98 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 11 Aug 2020 15:37:09 +0200 Subject: [PATCH] Fix memory leak in wxOverlay in wxOSX Define dealloc explicitly to make sure the property is released. --- src/osx/cocoa/overlay.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/overlay.mm b/src/osx/cocoa/overlay.mm index 939c59cab4..5506c1812d 100644 --- a/src/osx/cocoa/overlay.mm +++ b/src/osx/cocoa/overlay.mm @@ -64,7 +64,7 @@ self = [super initWithContentRect:contentRect styleMask:style backing:backingStoreType defer:flag]; if ( self ) { - self.overlayView = [[wxOSXOverlayView alloc] initWithFrame:contentRect]; + self.overlayView = [[[wxOSXOverlayView alloc] initWithFrame:contentRect] autorelease]; [self setContentView:self.overlayView]; [self setOpaque:NO]; @@ -75,6 +75,10 @@ return self; } +- (void)dealloc +{ + [super dealloc]; +} @end @implementation wxOSXOverlayView