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);
|
uiControlDestroy(w->child);
|
||||||
}
|
}
|
||||||
[windowDelegate unregisterWindow:w];
|
[windowDelegate unregisterWindow:w];
|
||||||
// TODO make sure this next line is right
|
|
||||||
[w->window release];
|
[w->window release];
|
||||||
uiFreeControl(uiControl(w));
|
uiFreeControl(uiControl(w));
|
||||||
}
|
}
|
||||||
|
@ -248,9 +247,9 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
||||||
defer:YES];
|
defer:YES];
|
||||||
[w->window setTitle:toNSString(title)];
|
[w->window setTitle:toNSString(title)];
|
||||||
|
|
||||||
// explicitly release when closed
|
// do NOT release when closed
|
||||||
// the only thing that closes the window is us anyway
|
// we manually do this in uiWindowDestroy() above
|
||||||
[w->window setReleasedWhenClosed:YES];
|
[w->window setReleasedWhenClosed:NO];
|
||||||
|
|
||||||
if (windowDelegate == nil) {
|
if (windowDelegate == nil) {
|
||||||
windowDelegate = [windowDelegateClass new];
|
windowDelegate = [windowDelegateClass new];
|
||||||
|
|
Loading…
Reference in New Issue