diff options
author | R. Belmont <rb6502@users.noreply.github.com> | 2011-07-18 22:37:20 +0000 |
---|---|---|
committer | R. Belmont <rb6502@users.noreply.github.com> | 2011-07-18 22:37:20 +0000 |
commit | 77e86084aba88b5d136bcfc0cd77d6ca3985a793 (patch) | |
tree | 010c27b935cadd02ee9d6701385d267be0e8709b /src/osd/sdl | |
parent | 44ad8a207f00ae1ed3864a2a74acdab1891354e9 (diff) |
Fix autorelease pool warnings when running multithreaded on Mac OS X [Tim Lindner]
Diffstat (limited to 'src/osd/sdl')
-rw-r--r-- | src/osd/sdl/sdl.mak | 2 | ||||
-rw-r--r-- | src/osd/sdl/sdlwork.c | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak index 7ce9e398af0..0cf9af2a8b9 100644 --- a/src/osd/sdl/sdl.mak +++ b/src/osd/sdl/sdl.mak @@ -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) diff --git a/src/osd/sdl/sdlwork.c b/src/osd/sdl/sdlwork.c index 8959855cc51..265ec1c6a1e 100644 --- a/src/osd/sdl/sdlwork.c +++ b/src/osd/sdl/sdlwork.c @@ -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; } |