X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=cffb3d57308c54b7f11da79d15613033b745c64f;hp=b822651b7ee853da1a91cc152f911fc9fba7eb3a;hb=b5bc313d9b1f25c30d212ab0dafe0eabc6002e43;hpb=d0cb9e8d04012519ce1a30cf238275cb645a9294 diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index b822651b7..cffb3d573 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -467,23 +467,22 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName SMESH_Hypothesis_i* myHypothesis_i = 0; SMESH::SMESH_Hypothesis_var hypothesis_i; std::string aPlatformLibName; - typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char* ); - GenericHypothesisCreator_i* aCreator = getHypothesisCreator(theHypName, theLibName, aPlatformLibName); - // create a new hypothesis object, store its ref. in studyContext - if(MYDEBUG) MESSAGE("Create Hypothesis " << theHypName); - myHypothesis_i = - myHypCreatorMap[string(theHypName)]->Create(myPoa, GetCurrentStudyID(), &myGen); - myHypothesis_i->SetLibName(aPlatformLibName.c_str()); // for persistency assurance - - if (!myHypothesis_i) - return hypothesis_i._retn(); + GenericHypothesisCreator_i* aCreator = + getHypothesisCreator(theHypName, theLibName, aPlatformLibName); - // activate the CORBA servant of hypothesis - hypothesis_i = myHypothesis_i->_this(); - int nextId = RegisterObject( hypothesis_i ); - if(MYDEBUG) { MESSAGE( "Add hypo to map with id = "<< nextId ); } - else { nextId = 0; } // avoid "unused variable" warning in release mode + // create a new hypothesis object, store its ref. in studyContext + myHypothesis_i = aCreator->Create(myPoa, GetCurrentStudyID(), &myGen); + if (myHypothesis_i) + { + myHypothesis_i->SetLibName(aPlatformLibName.c_str()); // for persistency assurance + myHypCreatorMap[ myHypothesis_i->GetName() ] = aCreator; + // activate the CORBA servant of hypothesis + hypothesis_i = myHypothesis_i->_this(); + int nextId = RegisterObject( hypothesis_i ); + if(MYDEBUG) { MESSAGE( "Add hypo to map with id = "<< nextId ); } + else { nextId = 0; } // avoid "unused variable" warning in release mode + } return hypothesis_i._retn(); }