CreatePrs3d(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration, bool theAddToStudy = true)
{
- TPrs3d_i* aPresent = NULL;
if(myStudyDocument->GetProperties()->IsLocked())
- return aPresent;
+ return NULL;
typedef typename TPrs3d_i::TInterface TPrs3d;
typename TPrs3d::_var_type aPrs3d;
Mutex mt(myMutex);
if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
if(TPrs3d_i::IsPossible(pResult,theMeshName,theEntity,theFieldName,int(theIteration))){
- aPresent = new TPrs3d_i(pResult,theAddToStudy);
- if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)) == NULL)
- aPresent->_remove_ref();
+ TPrs3d_i* aPresent = new TPrs3d_i(pResult,theAddToStudy);
+ try{
+ if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
+ return aPresent;
+ }catch(...){
+ }
+ aPresent->_remove_ref();
}
}
- return aPresent;
+ return NULL;
}
template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type