mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
Remove NSAutoreleasePools that are no longer necessary now that pools
are properly declared at thread entry/exit. I am leaving the ones in Wiiuse while there's still a small hope that it may be used outside of Dolphin, though. Move the fixed MAP_32BIT definition for OS X to Common.h. UDPNunchuk.cpp was deleted, so update the scons build. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5864 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -113,6 +113,7 @@ extern const char *netplay_dolphin_ver;
|
||||
|
||||
#ifdef __APPLE__
|
||||
#if defined HAVE_WX && HAVE_WX
|
||||
#define MAP_32BIT 0 // MAP_32BIT is a Linux-specific mmap(2) flag
|
||||
#define USE_WX 1 // Use wxGLCanvas
|
||||
#endif // HAVE_WX
|
||||
#else // __APPLE__
|
||||
|
@ -322,14 +322,13 @@ int appleMain(int argc, char *argv[]);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
cocoaArgc = argc;
|
||||
cocoaArgv = argv;
|
||||
|
||||
cocoaCreateApp();
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
CocoaThread *thread = [[CocoaThread alloc] init];
|
||||
NSEvent *event = [[NSEvent alloc] init];
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
@implementation NSApplication(i)
|
||||
- (void)appRunning
|
||||
{
|
||||
_running = 1;
|
||||
_running = 1;
|
||||
}
|
||||
@end
|
||||
|
||||
@ -14,22 +14,20 @@
|
||||
@implementation cocoaAppDelegate : NSObject
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||
{
|
||||
return NSTerminateCancel;
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
@end
|
||||
|
||||
void cocoaCreateApp()
|
||||
{
|
||||
ProcessSerialNumber psn;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
if (!GetCurrentProcess(&psn)) {
|
||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||
TransformProcessType(&psn,
|
||||
kProcessTransformToForegroundApplication);
|
||||
SetFrontProcess(&psn);
|
||||
}
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
if (NSApp == nil) {
|
||||
[NSApplication sharedApplication];
|
||||
//TODO : Create menu
|
||||
@ -41,16 +39,12 @@ void cocoaCreateApp()
|
||||
}
|
||||
|
||||
[NSApp appRunning];
|
||||
|
||||
[pool release];
|
||||
|
||||
}
|
||||
|
||||
bool cocoaKeyCode(NSEvent *event)
|
||||
{
|
||||
static bool CMDDown = false, QDown = false;
|
||||
bool Return = false;
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSConnection *connec = [[NSConnection new] autorelease];
|
||||
|
||||
@ -78,15 +72,11 @@ bool cocoaKeyCode(NSEvent *event)
|
||||
if( QDown && CMDDown )
|
||||
Return = true;
|
||||
|
||||
[pool release];
|
||||
return Return;
|
||||
}
|
||||
|
||||
bool cocoaSendEvent(NSEvent *event)
|
||||
{
|
||||
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
if ( event != nil ) {
|
||||
switch ([event type]) {
|
||||
case NSKeyDown:
|
||||
@ -100,10 +90,5 @@ bool cocoaSendEvent(NSEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[pool release];
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user