From 2cabb20bd230a4f02141986a57875737493d1c6c Mon Sep 17 00:00:00 2001 From: Jonathan Hearn Date: Mon, 30 Dec 2019 22:07:05 +0000 Subject: [PATCH] #439 rearranged order in choiceRestoration to ensure _currentEntry is set before clone, and thus the resulting updateGUI --- Engine/KnobTypes.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Engine/KnobTypes.cpp b/Engine/KnobTypes.cpp index 934b6b2fc3..d625edacf6 100644 --- a/Engine/KnobTypes.cpp +++ b/Engine/KnobTypes.cpp @@ -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) { @@ -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); }