Skip to content

Commit

Permalink
#439 rearranged order in choiceRestoration to ensure _currentEntry is…
Browse files Browse the repository at this point in the history
… set before clone, and thus the resulting updateGUI
  • Loading branch information
splidje committed Dec 30, 2019
1 parent dd13ca8 commit 2cabb20
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Engine/KnobTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,16 +1140,7 @@ KnobChoice::choiceRestoration(KnobChoice* knob,
{
assert(knob);

///Clone first and then handle restoration of the static value
clone(knob);
setSecret( knob->getIsSecret() );
if ( getDimension() == knob->getDimension() ) {
for (int i = 0; i < knob->getDimension(); ++i) {
setEnabled( i, knob->isEnabled(i) );
}
}


// ensure _currentEntry is set before eventually triggering GUI update
{
QMutexLocker k(&_entriesMutex);
if (id >= 0) {
Expand All @@ -1160,6 +1151,15 @@ KnobChoice::choiceRestoration(KnobChoice* knob,
}
}

///Clone first and then handle restoration of the static value
clone(knob);
setSecret( knob->getIsSecret() );
if ( getDimension() == knob->getDimension() ) {
for (int i = 0; i < knob->getDimension(); ++i) {
setEnabled( i, knob->isEnabled(i) );
}
}

if (id >= 0) {
setValue(id);
}
Expand Down

0 comments on commit 2cabb20

Please sign in to comment.