From c921239cf3d74b51a8985a77536bb73d8b419454 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 20 Oct 2005 06:44:39 +0000 Subject: [PATCH] Fix for Bug GVIEW10329 Crash processing bad med file --- src/VISU_I/VISU_ColoredPrs3d_i.cc | 4 ++-- src/VISU_I/VISU_Gen_i.hh | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 4c6e2dff..a47ea458 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -639,10 +639,10 @@ VISU::ColoredPrs3d_i } }catch(std::exception& exc){ INFOS("Follow exception was occured :\n"<CommitCommand(); diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index f8157bfd..a387b2e5 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -59,21 +59,24 @@ namespace VISU{ 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(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::TInterface::_var_type -- 2.39.2