From 1a2a3e9c8b52a4ab8a276388ff55aa4e3c1abbec Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 20 Mar 2014 10:04:23 -0400 Subject: [PATCH] Static analysis fix: Fixed leaking Objective-C object. --- src/video/cocoa/SDL_cocoaevents.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m index 438385c37..1623adb96 100644 --- a/src/video/cocoa/SDL_cocoaevents.m +++ b/src/video/cocoa/SDL_cocoaevents.m @@ -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 @@ Cocoa_RegisterApp(void) pool = [[NSAutoreleasePool alloc] init]; if (NSApp == nil) { [SDLApplication sharedApplication]; + SDL_assert(NSApp != nil); if ([NSApp mainMenu] == nil) { CreateApplicationMenus(); @@ -276,7 +278,7 @@ Cocoa_RegisterApp(void) [NSNumber numberWithBool:NO], @"ApplePressAndHoldEnabled", nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; - + [appDefaults release]; } if (NSApp && !appDelegate) { appDelegate = [[SDLAppDelegate alloc] init];