summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/sdlwork.c
diff options
context:
space:
mode:
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
commit77e86084aba88b5d136bcfc0cd77d6ca3985a793 (patch)
tree010c27b935cadd02ee9d6701385d267be0e8709b /src/osd/sdl/sdlwork.c
parent44ad8a207f00ae1ed3864a2a74acdab1891354e9 (diff)
Fix autorelease pool warnings when running multithreaded on Mac OS X [Tim Lindner]
Diffstat (limited to 'src/osd/sdl/sdlwork.c')
-rw-r--r--src/osd/sdl/sdlwork.c12
1 files changed, 12 insertions, 0 deletions
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;
}