diff --git a/src/debug/debug.cpp b/src/debug/debug.cpp index 3379bc9b..998d2bac 100644 --- a/src/debug/debug.cpp +++ b/src/debug/debug.cpp @@ -268,8 +268,13 @@ bool CBreakpoint::CheckIntBreakpoint(PhysPt adr, Bit8u intNr, Bit16u ahValue) void CBreakpoint::DeleteAll() { - // Search matching breakpoint - CBreakpoint::ActivateBreakpoints(0,false); + std::list::iterator i; + CBreakpoint* bp; + for(i=BPoints.begin(); i != BPoints.end(); i++) { + bp = static_cast(*i); + bp->Activate(false); + delete bp; + }; (BPoints.clear)(); }; @@ -959,6 +964,11 @@ void DEBUG_SetupConsole(void) DBGUI_StartUp(); }; +static void DEBUG_ShutDown(Section * sec) +{ + CBreakpoint::DeleteAll(); +}; + void DEBUG_Init(Section* sec) { DEBUG_DrawScreen(); @@ -969,13 +979,10 @@ void DEBUG_Init(Section* sec) { memset((void*)&codeViewData,0,sizeof(codeViewData)); /* setup debug.com */ PROGRAMS_MakeFile("DEBUG.COM",DEBUG_ProgramStart); + /* shutdown function */ + sec->AddDestroyFunction(&DEBUG_ShutDown); } -void DEBUG_ShutDown() -{ - CBreakpoint::DeleteAll(); -}; - // HEAVY DEBUGGING STUFF #if C_HEAVY_DEBUG