Fixed up uiWindow ownership mechanics in the Darwin backend.
This commit is contained in:
parent
5a4b6aa6f0
commit
3705ef05d1
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue