]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL17668
authorapo <apo@opencascade.com>
Thu, 22 Nov 2007 13:27:08 +0000 (13:27 +0000)
committerapo <apo@opencascade.com>
Thu, 22 Nov 2007 13:27:08 +0000 (13:27 +0000)
   TC71: REGR: copy object leads to fatal error and unknown exception

src/VISUGUI/VisuGUI.cxx
src/VISU_I/VISU_ColoredPrs3dFactory.hh

index 0bd5b847684c9e9e10026bf16a312d306ff9d215..bfb32d0d7945a85ae3b01caedd1f43223cf2bff2 100644 (file)
@@ -1817,31 +1817,31 @@ VisuGUI
     VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(aBase);
     switch (aBase->GetType()) {
     case VISU::TSCALARMAP:
-      TSameAsFactory<VISU::TSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp);
+      TSameAsFactory<VISU::TSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TDEFORMEDSHAPE:
-      TSameAsFactory<VISU::TDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp);
+      TSameAsFactory<VISU::TDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TSCALARMAPONDEFORMEDSHAPE:
-      TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp);
+      TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TCUTPLANES:
-      TSameAsFactory<VISU::TCUTPLANES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp);
+      TSameAsFactory<VISU::TCUTPLANES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TCUTLINES:
-      TSameAsFactory<VISU::TCUTLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp);
+      TSameAsFactory<VISU::TCUTLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TISOSURFACES:
-      TSameAsFactory<VISU::TISOSURFACES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp);
+      TSameAsFactory<VISU::TISOSURFACES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TSTREAMLINES:
-      TSameAsFactory<VISU::TSTREAMLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp);
+      TSameAsFactory<VISU::TSTREAMLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TVECTORS:
-      TSameAsFactory<VISU::TVECTORS>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp);
+      TSameAsFactory<VISU::TVECTORS>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TPLOT3D:
-      TSameAsFactory<VISU::TPLOT3D>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp);
+      TSameAsFactory<VISU::TPLOT3D>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     }
     UpdateObjBrowser(this);
index 1852297c648a2d8c4ae8590a69cb2ca90879b190..eae438dde6f3c32cd0e1d90887a1461728d257cc 100644 (file)
@@ -287,11 +287,13 @@ namespace VISU
 
     SALOME::GenericObjPtr<TColoredPrs3d>
     Create(ColoredPrs3d_i* theColoredPrs3d,
-          ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
+          ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode,
+          bool theCreateAsTemporalObject = true)
     {
       SALOME::GenericObjPtr<TColoredPrs3d> aSameColoredPrs3d(new TColoredPrs3d(thePublishInStudyMode));
       Copy(theColoredPrs3d, aSameColoredPrs3d);
-      aSameColoredPrs3d->Destroy();
+      if ( theCreateAsTemporalObject )
+       aSameColoredPrs3d->Destroy();
       return aSameColoredPrs3d;
     }
   };