Fix SIGSEGV in destructor of GEOM_Engine.

This commit is contained in:
vsr 2010-10-15 09:27:53 +00:00
parent 115b890476
commit 481b82fcad

View File

@ -189,10 +189,12 @@ GEOM_Engine::GEOM_Engine()
GEOM_Engine::~GEOM_Engine() GEOM_Engine::~GEOM_Engine()
{ {
GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It(_objects); GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It(_objects);
std::list< Handle(GEOM_Object) > objs;
for(; It.More(); It.Next()) for(; It.More(); It.Next())
{ objs.push_back( Handle(GEOM_Object)::DownCast(It.Value()) );
RemoveObject(Handle(GEOM_Object)::DownCast(It.Value())); std::list< Handle(GEOM_Object) >::iterator objit;
} for(objit = objs.begin(); objit != objs.end(); ++objit)
RemoveObject(*objit);
//Close all documents not closed //Close all documents not closed
for(Interface_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next()) for(Interface_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next())