I have a following c++ code:
typedef std::list< Volume >::iterator pVolume;
typedef std::list< pVolume >::iterator ppVolume;
void Node::delVolume( pVolume _volume )
{
for( ppVolume it = m_volumes.begin( ); it != m_volumes.end( ); )
if( (*it) == _volume )
{
it = m_volumes.erase( it );
break;
}
else
it++;
}
it gets an error
Unhandled exception at 0x009a3c79 in Delone3D.exe: 0xC0000005: Access violation reading location 0xfeeefef2.
exactly when erasing. Debug shows that neither "it" nor "_volume" is null pointer.
What other reasons this may occur for?