Fix a memory leak. We need to clean up our autorelease pool code at some point.
This commit is contained in:
parent
a20096403e
commit
89124cba8b
1 changed files with 4 additions and 0 deletions
|
@ -235,6 +235,7 @@ Cocoa_GetDisplayName(CGDirectDisplayID displayID)
|
|||
void
|
||||
Cocoa_InitModes(_THIS)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
CGDisplayErr result;
|
||||
CGDirectDisplayID *displays;
|
||||
CGDisplayCount numDisplays;
|
||||
|
@ -243,6 +244,7 @@ Cocoa_InitModes(_THIS)
|
|||
result = CGGetOnlineDisplayList(0, NULL, &numDisplays);
|
||||
if (result != kCGErrorSuccess) {
|
||||
CG_SetError("CGGetOnlineDisplayList()", result);
|
||||
[pool release];
|
||||
return;
|
||||
}
|
||||
displays = SDL_stack_alloc(CGDirectDisplayID, numDisplays);
|
||||
|
@ -250,6 +252,7 @@ Cocoa_InitModes(_THIS)
|
|||
if (result != kCGErrorSuccess) {
|
||||
CG_SetError("CGGetOnlineDisplayList()", result);
|
||||
SDL_stack_free(displays);
|
||||
[pool release];
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -313,6 +316,7 @@ Cocoa_InitModes(_THIS)
|
|||
}
|
||||
}
|
||||
SDL_stack_free(displays);
|
||||
[pool release];
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue