]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug GVIEW10329
authorapo <apo@opencascade.com>
Thu, 20 Oct 2005 06:44:39 +0000 (06:44 +0000)
committerapo <apo@opencascade.com>
Thu, 20 Oct 2005 06:44:39 +0000 (06:44 +0000)
  Crash processing bad med file

src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_Gen_i.hh

index 4c6e2dff16796e98f0fa0573bf66ffb886f9365e..a47ea458f7807be5e5f0e5739f2f364b499551e8 100644 (file)
@@ -639,10 +639,10 @@ VISU::ColoredPrs3d_i
     }
   }catch(std::exception& exc){
     INFOS("Follow exception was occured :\n"<<exc.what());
-    return NULL;
+    throw;
   }catch(...){
     INFOS("Unknown exception was occured!");
-    return NULL;
+    throw;
   }
   if(myAddToStudy) 
     aStudyBuilder->CommitCommand();
index f8157bfd156f4d3166bd8fc5a44645c728d8fb10..a387b2e5186ba9292f35130ce3da052169edde2c 100644 (file)
@@ -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<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