diff --git a/src/osd/modules/debugger/debugosx.m b/src/osd/modules/debugger/debugosx.m index 3b9c971483b..491aefbedda 100644 --- a/src/osd/modules/debugger/debugosx.m +++ b/src/osd/modules/debugger/debugosx.m @@ -54,14 +54,8 @@ public: [m_console release]; } - virtual int init() - { - return 0; - } - - virtual void exit() - { - } + virtual int init(); + virtual void exit(); virtual void init_debugger(running_machine &machine); virtual void wait_for_debugger(device_t &device, bool firststop); @@ -74,13 +68,41 @@ private: MODULE_DEFINITION(DEBUG_OSX, debugger_osx) +//============================================================ +// debugger_osx::init +//============================================================ + +int debugger_osx::init() +{ + return 0; +} + +//============================================================ +// debugger_osx::exit +//============================================================ + +void debugger_osx::exit() +{ + if (m_console) + { + NSDictionary *info = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:m_machine] + forKey:@"MAMEDebugMachine"]; + [[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification + object:m_console + userInfo:info]; + [m_console release]; + m_console = nil; + m_machine = NULL; + } +} + //============================================================ // debugger_osx::init_debugger //============================================================ void debugger_osx::init_debugger(running_machine &machine) { - m_machine = &machine; + m_machine = &machine; } //============================================================ @@ -94,7 +116,8 @@ void debugger_osx::wait_for_debugger(device_t &device, bool firststop) m_console = [[MAMEDebugConsole alloc] initWithMachine:*m_machine]; // make sure the debug windows are visible - if (firststop) { + if (firststop) + { NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithPointer:&device], @"MAMEDebugDevice", [NSValue valueWithPointer:m_machine],