From 3705ef05d1b3bc2883d0f05ed400e38fe51c9bda Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 22 May 2016 12:15:50 -0400 Subject: [PATCH] Fixed up uiWindow ownership mechanics in the Darwin backend. --- darwin/window.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/darwin/window.m b/darwin/window.m index a36cff83..1ece3f1e 100644 --- a/darwin/window.m +++ b/darwin/window.m @@ -93,7 +93,6 @@ static void uiWindowDestroy(uiControl *c) uiControlDestroy(w->child); } [windowDelegate unregisterWindow:w]; - // TODO make sure this next line is right [w->window release]; uiFreeControl(uiControl(w)); } @@ -248,9 +247,9 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) defer:YES]; [w->window setTitle:toNSString(title)]; - // explicitly release when closed - // the only thing that closes the window is us anyway - [w->window setReleasedWhenClosed:YES]; + // do NOT release when closed + // we manually do this in uiWindowDestroy() above + [w->window setReleasedWhenClosed:NO]; if (windowDelegate == nil) { windowDelegate = [windowDelegateClass new];