Fix Cocoa debugger leaks with SDL2, still looking into crash on exit

This commit is contained in:
Vas Crabb 2015-04-01 12:44:42 +11:00
parent a469d29eb8
commit cb10350dd4
2 changed files with 8 additions and 0 deletions

View File

@ -82,6 +82,7 @@ int debugger_osx::init()
void debugger_osx::exit()
{
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
if (m_console)
{
NSDictionary *info = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:m_machine]
@ -93,6 +94,7 @@ void debugger_osx::exit()
m_console = nil;
m_machine = NULL;
}
[pool release];
}
//============================================================
@ -110,6 +112,8 @@ void debugger_osx::init_debugger(running_machine &machine)
void debugger_osx::wait_for_debugger(device_t &device, bool firststop)
{
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
// create a console window
if (m_console == nil)
m_console = [[MAMEDebugConsole alloc] initWithMachine:*m_machine];
@ -134,6 +138,8 @@ void debugger_osx::wait_for_debugger(device_t &device, bool firststop)
dequeue:YES];
if (ev != nil)
[NSApp sendEvent:ev];
[pool release];
}

View File

@ -36,7 +36,9 @@ static NSCharacterSet *NonWhiteCharacters;
static void debugwin_view_update(debug_view &view, void *osdprivate)
{
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
[(MAMEDebugView *)osdprivate update];
[pool release];
}