debug_shutdown method now registered in section and fixed a memleak.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@421
This commit is contained in:
parent
b4dd2c93ca
commit
2d6d76fb42
1 changed files with 14 additions and 7 deletions
|
@ -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<CBreakpoint*>::iterator i;
|
||||
CBreakpoint* bp;
|
||||
for(i=BPoints.begin(); i != BPoints.end(); i++) {
|
||||
bp = static_cast<CBreakpoint*>(*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
|
||||
|
|
Loading…
Add table
Reference in a new issue