From b1585ae2522eefd50c83c506df0c50d07f0290af Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 22 Nov 2007 13:27:08 +0000 Subject: [PATCH] Fix for Bug IPAL17668 TC71: REGR: copy object leads to fatal error and unknown exception --- src/VISUGUI/VisuGUI.cxx | 18 +++++++++--------- src/VISU_I/VISU_ColoredPrs3dFactory.hh | 6 ++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 0bd5b847..bfb32d0d 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1817,31 +1817,31 @@ VisuGUI VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast(aBase); switch (aBase->GetType()) { case VISU::TSCALARMAP: - TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp); + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; case VISU::TDEFORMEDSHAPE: - TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp); + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; case VISU::TSCALARMAPONDEFORMEDSHAPE: - TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp); + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; case VISU::TCUTPLANES: - TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp); + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; case VISU::TCUTLINES: - TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp); + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; case VISU::TISOSURFACES: - TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp); + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; case VISU::TSTREAMLINES: - TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp); + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; case VISU::TVECTORS: - TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp); + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; case VISU::TPLOT3D: - TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp); + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; } UpdateObjBrowser(this); diff --git a/src/VISU_I/VISU_ColoredPrs3dFactory.hh b/src/VISU_I/VISU_ColoredPrs3dFactory.hh index 1852297c..eae438dd 100644 --- a/src/VISU_I/VISU_ColoredPrs3dFactory.hh +++ b/src/VISU_I/VISU_ColoredPrs3dFactory.hh @@ -287,11 +287,13 @@ namespace VISU SALOME::GenericObjPtr Create(ColoredPrs3d_i* theColoredPrs3d, - ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode) + ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode, + bool theCreateAsTemporalObject = true) { SALOME::GenericObjPtr aSameColoredPrs3d(new TColoredPrs3d(thePublishInStudyMode)); Copy(theColoredPrs3d, aSameColoredPrs3d); - aSameColoredPrs3d->Destroy(); + if ( theCreateAsTemporalObject ) + aSameColoredPrs3d->Destroy(); return aSameColoredPrs3d; } }; -- 2.39.2