mirror of
https://github.com/holub/mame
synced 2025-06-01 18:41:47 +03:00
Fix autorelease pool warnings when running multithreaded on Mac OS X [Tim Lindner]
This commit is contained in:
parent
44ad8a207f
commit
77e86084ab
@ -405,7 +405,7 @@ endif # Win32
|
||||
#-------------------------------------------------
|
||||
|
||||
ifeq ($(BASE_TARGETOS),macosx)
|
||||
#OSDCOREOBJS += $(SDLOBJ)/osxutils.o
|
||||
OSDCOREOBJS += $(SDLOBJ)/osxutils.o
|
||||
|
||||
ifndef MACOSX_USE_LIBSDL
|
||||
# Compile using framework (compile using libSDL is the exception)
|
||||
|
@ -30,6 +30,9 @@ int sdl_num_processors = 0;
|
||||
|
||||
#include "eminline.h"
|
||||
|
||||
#if defined(SDLMAME_MACOSX)
|
||||
#include "osxutils.h"
|
||||
#endif
|
||||
|
||||
//============================================================
|
||||
// DEBUGGING
|
||||
@ -627,6 +630,10 @@ static void *worker_thread_entry(void *param)
|
||||
work_thread_info *thread = (work_thread_info *)param;
|
||||
osd_work_queue *queue = thread->queue;
|
||||
|
||||
#if defined(SDLMAME_MACOSX)
|
||||
void *arp = NewAutoreleasePool();
|
||||
#endif
|
||||
|
||||
// loop until we exit
|
||||
for ( ;; )
|
||||
{
|
||||
@ -678,6 +685,11 @@ static void *worker_thread_entry(void *param)
|
||||
atomic_exchange32(&thread->active, FALSE);
|
||||
atomic_decrement32(&queue->livethreads);
|
||||
}
|
||||
|
||||
#if defined(SDLMAME_MACOSX)
|
||||
ReleaseAutoreleasePool(arp);
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user