From: jrt Date: Tue, 16 Mar 2004 12:51:43 +0000 (+0000) Subject: Fix bug SMESH5451: SMESH_mechanic script aborts. X-Git-Tag: V1_5_0~6 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=d09f5392183954305568ffc78fac88e4aacd9f0e;hp=e6982c22a69d4a5b88628e9ae59a359a01febbf2 Fix bug SMESH5451: SMESH_mechanic script aborts. --- 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");