mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
Added auto-release pools to decrease memory fragmentation on older OS X like 10.5 or 10.6
This commit is contained in:
parent
70bb80e2bf
commit
660ebf2c6c
1 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue