Comment 22 for bug 1635982

Revision history for this message
shark0r (shark0r) wrote :

I found the cause: ColorScales::_mode is not initialized in the constructor.

The constructor calls ColorScales::setMode(), and there is a line "if( _mode == mode) return;" in that function which _mode is ColorScales' member and mode is a parameter of the constructor. This assumes _mode's initial value is 0 so setMode() may not actually execute.

Why this problem only occurs in HSL tab? In theory _mode's initial value is undefined and this problem happens a bit randomly. In my environment _mode will frequently be the following values.

when building RGB tab (mode=1) -> _mode=3
HSL tab (mode=2) -> _mode=2 (cause setMode() doesn't actually run)
CMYK tab (mode=3) -> _mode=1

Patch attached, although only 1 line is changed.