From Wojciech Lewandowski, "osgSim::BlinkSequence has sequenceGroup unitialized by default (=NULL ref_ptr). By looking at the code I figured out that unset sequenceGroup is completely correct and thus allowed.
But writing BlinkSequence with empty sequence group caused a crash when IVE was accessing baseTime from NULL address. Atttached is a fix for this situation. "
This commit is contained in:
parent
b76b85770f
commit
1e996afe81
@ -43,7 +43,10 @@ void BlinkSequence::write(DataOutputStream* out){
|
||||
// Write out phase shift.
|
||||
out->writeDouble(getPhaseShift());
|
||||
// Write out SequenceGroup.
|
||||
out->writeDouble(getSequenceGroup()->_baseTime);
|
||||
if( getSequenceGroup() )
|
||||
out->writeDouble(getSequenceGroup()->_baseTime);
|
||||
else
|
||||
out->writeDouble( 0.0 );
|
||||
|
||||
}
|
||||
|
||||
@ -73,7 +76,6 @@ void BlinkSequence::read(DataInputStream* in){
|
||||
setPhaseShift(in->readDouble());
|
||||
// Read in SequenceGroup
|
||||
setSequenceGroup(new osgSim::SequenceGroup(in->readDouble()));
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("BlinkSequence::read(): Expected BlinkSequence identification.");
|
||||
|
Loading…
Reference in New Issue
Block a user