aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-03-07 02:20:04 +0100
committerTeddy Wing2021-03-07 02:20:45 +0100
commitb0523091cf13842f3fea9e21b34d8d611615e2a2 (patch)
tree7faa83f4a8d9b705bd15f44b11af9dd4d7d30a9c
parent33d51c99cc1125c8318008adc25adb93ad85158d (diff)
downloadRe-Good-Catalina-Invert-Colours-b0523091cf13842f3fea9e21b34d8d611615e2a2.tar.bz2
main: Autorelease `Invert` instance
Ensure the object is released.
-rw-r--r--main.m7
1 files changed, 3 insertions, 4 deletions
diff --git a/main.m b/main.m
index a7ea187..6390483 100644
--- a/main.m
+++ b/main.m
@@ -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;