On my 32 bit system (winXP) (using latest svn), when debugging CB from within CB, and having the debugee opening a project, and then closing that project, I'll get a crash on a delete statement :
void wxSmith::OnProjectClose(CodeBlocksEvent& event)
{
cbProject* Proj = event.GetProject();
ProjectMapI i = ProjectMap.find(Proj);
if ( i != ProjectMap.end() )
{
ProjectMap.erase(i);
}
wxsProject* SmithProj = (*i).second;
if ( SmithProj )
{
// SmithProj->SaveProject();
delete SmithProj;
}
event.Skip();
}
The SmithProj pointer is 0xfeeefeee, which seems rather bad ;-)
After issuing "ProjectMap.erase(i);" is it still save to "(*i).second" , this might be the problem.
Note : the if test just in front the delete is not needed, in C++ it is save to delete 0-pointers (ok, for those still using that damn non standard word : NULL-pointers).