From d7a541ca3dbc769465e69203ba065f7ca1f135f6 Mon Sep 17 00:00:00 2001 From: imn Date: Thu, 17 Nov 2016 16:35:58 +0300 Subject: [PATCH] Fixed SIGSEGV after execute python command "myStudy.Clear()" --- src/GEOM/GEOM_Engine.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index 1386f6c77..abcd110d6 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -550,9 +550,14 @@ void GEOM_Engine::Close() { if (_document) { //Remove all GEOM Objects associated to the document + TColStd_SequenceOfAsciiString aSeq; GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It (_objects); - for (; It.More(); It.Next()) - _objects.UnBind(It.Key()); + for (; It.More(); It.Next()) { + aSeq.Append(It.Key()); + } + for (Standard_Integer i=1; i<=aSeq.Length(); i++) { + _objects.UnBind(aSeq.Value(i)); + } // Forget free labels for document _freeLabels.clear(); -- 2.39.2