From 3deabbf16b9fadd14eb4cec1e7e758d37396c7ff Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 26 Nov 2007 12:20:38 +0000 Subject: [PATCH] Bug IPAL17674 - 4.x, regression: SIGSEGV after trying to "Show" saved animation. --- src/VISU_I/VISU_TimeAnimation.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index 70946d1d..dcee2bc1 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -1750,7 +1750,7 @@ void VISU_TimeAnimation::saveAnimation() std::string aSComponentEntry = aSComponent->GetID(); QString aComment; - aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;myMode=%d", + aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;mySequence=%s;myMode=%d", myTimeMinVal, myTimeMaxVal, mySequence.latin1(), @@ -1880,9 +1880,13 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField) VISU::Storable::TRestoringMap aPrsMap = VISU::Storable::GetStorableMap(aPrsObj); if (aPrsMap.empty()) continue; - aData.myPrs[0]->Restore(VISU::GetSObject(aData.myField), aPrsMap); - aData.myPrs[0]->GetOffset(aData.myOffset); + if (aData.myPrs[0]) { + aData.myPrs[0]->Restore(VISU::GetSObject(aData.myField), aPrsMap); + aData.myPrs[0]->GetOffset(aData.myOffset); + } for (int i = 1; i < aData.myNbFrames; i++) { + if (!aData.myPrs[0]) + continue; bool anIsFixedRange = false; if (aData.myPrsType != VISU::TGAUSSPOINTS) { if (VISU::ScalarMap_i* aPrs = dynamic_cast(aData.myPrs[i])) @@ -2164,7 +2168,7 @@ char* VISU_TimeAnimation_i::getAnimationSequence() CORBA::Boolean VISU_TimeAnimation_i::isSequenceDefined() { - return myAnim->isRangeDefined(); + return myAnim->isSequenceDefined(); } void VISU_TimeAnimation_i::dumpTo (const char* thePath) -- 2.39.2