From ea7338ddf9678665f8f59948225077d24afa3a93 Mon Sep 17 00:00:00 2001 From: "SND\\edgbla_cp" Date: Fri, 11 Nov 2011 12:08:23 +0000 Subject: 10797, 10798 (MaddTheSane). git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72170 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/EmuThread.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'macosx/EmuThread.m') diff --git a/macosx/EmuThread.m b/macosx/EmuThread.m index 384e542b..0b47e514 100644 --- a/macosx/EmuThread.m +++ b/macosx/EmuThread.m @@ -33,7 +33,7 @@ static pthread_mutex_t eventMutex; - (void)EmuThreadRun:(id)anObject { - pool = [[NSAutoreleasePool alloc] init]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(emuWindowDidClose:) @@ -76,7 +76,7 @@ static pthread_mutex_t eventMutex; psxCpu->Execute(); done: - [pool release]; pool = nil; + [pool drain]; emuThread = nil; return; @@ -84,7 +84,7 @@ done: - (void)EmuThreadRunBios:(id)anObject { - pool = [[NSAutoreleasePool alloc] init]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(emuWindowDidClose:) @@ -110,7 +110,7 @@ done: psxCpu->Execute(); done: - [pool release]; pool = nil; + [pool drain]; emuThread = nil; return; @@ -121,9 +121,6 @@ done: // remove all registered observers [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:nil]; - if (pool) - [pool release]; - [super dealloc]; } @@ -152,6 +149,7 @@ done: and we can just handle events next time round */ if (pthread_mutex_trylock(&eventMutex) == 0) { while (safeEvent) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (safeEvent & EMUEVENT_STOP) { /* signify that the emulation has stopped */ [emuThread autorelease]; @@ -199,6 +197,7 @@ done: /* wait until we're signalled */ pthread_cond_wait(&eventCond, &eventMutex); } + [pool drain]; } pthread_mutex_unlock(&eventMutex); } -- cgit v1.2.3