Equip any new threads with an NSAutoreleasePool.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6978 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-01-29 23:46:26 +00:00
parent 2e4fae2b80
commit 2de8742368
3 changed files with 10 additions and 32 deletions

View File

@ -18,6 +18,10 @@
#define USE_RVALUE_REFERENCES
#endif
#ifdef __APPLE__
#import <Foundation/NSAutoreleasePool.h>
#endif
#if defined(_WIN32)
// WIN32
@ -256,9 +260,14 @@ private:
template <typename F>
static THREAD_RETURN RunAndDelete(void* param)
{
#ifdef __APPLE__
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
#endif
static_cast<F*>(param)->Run();
delete static_cast<F*>(param);
#ifdef __APPLE__
[pool release];
#endif
return 0;
}
};