diff options
| author | Teddy Wing | 2021-03-07 02:20:04 +0100 |
|---|---|---|
| committer | Teddy Wing | 2021-03-07 02:20:45 +0100 |
| commit | b0523091cf13842f3fea9e21b34d8d611615e2a2 (patch) | |
| tree | 7faa83f4a8d9b705bd15f44b11af9dd4d7d30a9c | |
| parent | 33d51c99cc1125c8318008adc25adb93ad85158d (diff) | |
| download | Re-Good-Catalina-Invert-Colours-b0523091cf13842f3fea9e21b34d8d611615e2a2.tar.bz2 | |
main: Autorelease `Invert` instance
Ensure the object is released.
| -rw-r--r-- | main.m | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -4,9 +4,11 @@ #import "DDHotKeyCenter.h" int main(int argc, const char * argv[]) { + [NSAutoreleasePool new]; + [NSApplication sharedApplication]; - Invert *invert = [[Invert alloc] init]; + Invert *invert = [[[Invert alloc] init] autorelease]; DDHotKeyCenter *c = [DDHotKeyCenter sharedHotKeyCenter]; if ( @@ -20,9 +22,6 @@ int main(int argc, const char * argv[]) { NSLog(@"Error registering hotkey"); } - // TODO: trap? - // [invert release]; - [NSApp run]; return 0; |
