From 454061ed04b249b8437e4dd3ff474415da31caf8 Mon Sep 17 00:00:00 2001 From: jrt Date: Tue, 23 Mar 2004 11:36:56 +0000 Subject: [PATCH] Fix bug SMESH5451: SMESH_mechanic script aborts. --- src/SMESHGUI/SMESHGUI_Swig.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SMESHGUI/SMESHGUI_Swig.cxx b/src/SMESHGUI/SMESHGUI_Swig.cxx index 2eace0798..db4ce870e 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.cxx +++ b/src/SMESHGUI/SMESHGUI_Swig.cxx @@ -104,6 +104,9 @@ void SMESH_Swig::Init(int studyID) myStudyBuilder->DefineComponentInstance(father, CompMesh ); if (aLocked) myStudy->GetProperties()->SetLocked(true); } + + mySComponentMesh=father; + // Tags definition Tag_HypothesisRoot = 1; Tag_AlgorithmsRoot = 2; @@ -136,6 +139,7 @@ const char* SMESH_Swig::AddNewMesh(const char* IOR) SALOMEDS::AttributePixMap_var aPixmap; SALOMEDS::SObject_var HypothesisRoot; + ASSERT(!mySComponentMesh->_is_nil()); if (!mySComponentMesh->FindSubObject (Tag_HypothesisRoot, HypothesisRoot)) { HypothesisRoot = myStudyBuilder->NewObjectToTag (mySComponentMesh, Tag_HypothesisRoot); anAttr = myStudyBuilder->FindOrCreateAttribute(HypothesisRoot, "AttributeName"); -- 2.39.2