Fixed up darwin/init.m a bit.
This commit is contained in:
parent
7c5740351c
commit
bf67a8b285
|
@ -23,6 +23,12 @@
|
||||||
|
|
||||||
@implementation appDelegate
|
@implementation appDelegate
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
[self.menuManager release];
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app
|
||||||
{
|
{
|
||||||
// for debugging
|
// for debugging
|
||||||
|
@ -37,11 +43,6 @@
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// we are not in control of the actual lifetimes and refcounts of NSViews (see http://stackoverflow.com/a/29523141/3408572)
|
|
||||||
// when we're done with a view, it'll be added as a subview of this one, and this one will be released on application shutdown
|
|
||||||
// we need this separate view because it's possible for controls to have no parent but still be alive
|
|
||||||
NSView *destroyedControlsView;
|
|
||||||
|
|
||||||
uiInitOptions options;
|
uiInitOptions options;
|
||||||
|
|
||||||
const char *uiInit(uiInitOptions *o)
|
const char *uiInit(uiInitOptions *o)
|
||||||
|
@ -59,9 +60,6 @@ const char *uiInit(uiInitOptions *o)
|
||||||
appDelegate().menuManager = [menuManager new];
|
appDelegate().menuManager = [menuManager new];
|
||||||
[NSApp setMainMenu:[appDelegate().menuManager makeMenubar]];
|
[NSApp setMainMenu:[appDelegate().menuManager makeMenubar]];
|
||||||
|
|
||||||
// we can use a stock NSView for this
|
|
||||||
destroyedControlsView = [[NSView alloc] initWithFrame:NSZeroRect];
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue