Static analysis fix: Fixed leaking Objective-C object.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 20 Mar 2014 10:04:23 -0400
changeset 8648 2b3eec53c66b
parent 8647 e2a51b0426a6
child 8649 4ee50f124da2
Static analysis fix: Fixed leaking Objective-C object.
src/video/cocoa/SDL_cocoaevents.m
--- a/src/video/cocoa/SDL_cocoaevents.m	Wed Mar 19 23:19:34 2014 -0400
+++ b/src/video/cocoa/SDL_cocoaevents.m	Thu Mar 20 10:04:23 2014 -0400
@@ -25,6 +25,7 @@
 
 #include "SDL_cocoavideo.h"
 #include "../../events/SDL_events_c.h"
+#include "SDL_assert.h"
 
 #if !defined(UsrActivity) && defined(__LP64__) && !defined(__POWER__)
 /*
@@ -266,6 +267,7 @@
     pool = [[NSAutoreleasePool alloc] init];
     if (NSApp == nil) {
         [SDLApplication sharedApplication];
+        SDL_assert(NSApp != nil);
 
         if ([NSApp mainMenu] == nil) {
             CreateApplicationMenus();
@@ -276,7 +278,7 @@
             [NSNumber numberWithBool:NO], @"ApplePressAndHoldEnabled",
             nil];
         [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
-
+        [appDefaults release];
     }
     if (NSApp && !appDelegate) {
         appDelegate = [[SDLAppDelegate alloc] init];