Added auto-release pools to decrease memory fragmentation on older OS X like 10.5 or 10.6

This commit is contained in:
alexey.lysiuk 2014-11-09 16:53:25 +02:00
parent 70bb80e2bf
commit 660ebf2c6c

View file

@ -1378,7 +1378,9 @@ static ApplicationController* appCtrl;
- (void)processEvents:(NSTimer*)timer - (void)processEvents:(NSTimer*)timer
{ {
ZD_UNUSED(timer); ZD_UNUSED(timer);
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
while (true) while (true)
{ {
NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask
@ -1435,6 +1437,8 @@ static ApplicationController* appCtrl;
} }
[NSApp updateWindows]; [NSApp updateWindows];
[pool release];
} }
@ -1513,6 +1517,8 @@ void I_SetMainWindowVisible(bool visible)
bool I_SetCursor(FTexture* cursorpic) bool I_SetCursor(FTexture* cursorpic)
{ {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
if (NULL == cursorpic || FTexture::TEX_Null == cursorpic->UseType) if (NULL == cursorpic || FTexture::TEX_Null == cursorpic->UseType)
{ {
s_cursor = [NSCursor arrowCursor]; s_cursor = [NSCursor arrowCursor];
@ -1567,7 +1573,9 @@ bool I_SetCursor(FTexture* cursorpic)
} }
[appCtrl invalidateCursorRects]; [appCtrl invalidateCursorRects];
[pool release];
return true; return true;
} }