Skip to content

Commit

Permalink
Static analysis fix: Fixed leaking Objective-C object.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 20, 2014
1 parent bcc2ed0 commit 1a2a3e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video/cocoa/SDL_cocoaevents.m
Expand Up @@ -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__)
/*
Expand Down Expand Up @@ -266,6 +267,7 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam
pool = [[NSAutoreleasePool alloc] init];
if (NSApp == nil) {
[SDLApplication sharedApplication];
SDL_assert(NSApp != nil);

if ([NSApp mainMenu] == nil) {
CreateApplicationMenus();
Expand All @@ -276,7 +278,7 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam
[NSNumber numberWithBool:NO], @"ApplePressAndHoldEnabled",
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];

[appDefaults release];
}
if (NSApp && !appDelegate) {
appDelegate = [[SDLAppDelegate alloc] init];
Expand Down

0 comments on commit 1a2a3e9

Please sign in to comment.