override applicationShouldTerminate so we can cleanup when we quit
BUG=skia: TBR= Review URL: https://codereview.chromium.org/636723002
This commit is contained in:
parent
5397725ca7
commit
3fc02f1720
@ -21,4 +21,7 @@
|
||||
@property (assign) IBOutlet SkOptionsTableView* fOptions;
|
||||
|
||||
- (IBAction)toiPadSize:(id)sender;
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
|
||||
|
||||
@end
|
||||
|
@ -1,4 +1,7 @@
|
||||
#import "SampleAppDelegate.h"
|
||||
|
||||
#include "SkApplication.h"
|
||||
|
||||
@implementation SampleAppDelegate
|
||||
@synthesize fWindow, fView, fOptions;
|
||||
|
||||
@ -13,4 +16,10 @@
|
||||
NSRect frame = NSMakeRect(fWindow.frame.origin.x, fWindow.frame.origin.y, 768, 1024);
|
||||
[fWindow setFrame:frame display:YES animate:YES];
|
||||
}
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
||||
application_term();
|
||||
return NSTerminateNow;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -14,7 +14,11 @@ int main(int argc, char *argv[]) {
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
application_init();
|
||||
int retVal = NSApplicationMain(argc, (const char **)argv);
|
||||
|
||||
#if 0
|
||||
// we don't expect NSApplicationMain to return. See our applicationShouldTerminate handler.
|
||||
application_term();
|
||||
[pool release];
|
||||
#endif
|
||||
return retVal;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user