I have an MFC dialog, which is called Dlg1
myobject* Dlg1 = new myobject();
This dialog has a parent dialog called A; I have a function in A, which is called on closing:
A::Destroy()
{
if(Dlg1 )
delete Dlg1; // this is triggering `DebugBreak(); here i get A.exe has triggered a breakpoint,
// the rest of the code
}
If I close Dlg1
dialog, manually by clicking on the close button, then close the main dialog A
, then everything is fine no problem. However, if Dlg1
is running and I close A, then I get DebugBreak()
. This issue occurs only in debug mode, in the release mode no problem.