this generates a segmentation fault becuase of \"QColor colorMap[9]\";. If I remove colorMap the segmentation fault goes away. If I put it back. It comes back. If I do a clean
If I do a clean all then build all, it goes away.
This makes it sound as though your build system isn't recognizing a dependency and that a change to that class definition isn't triggering a rebuild of something that should be recompiled when the definition changes.
Make sure class LevelIndicator
is defined in exactly one place (generally that would be a header file that gets included by whatever modules need to use a LevelIndicator
object). Also make sure that any global/static instances of LevelIndicator
objects are following the one definition rule.
Firstly it might not be QColor, that may simply be changing the memory layout enough that a buffer overrun somewhere else triggers a segfault - try a different size QColor ..[1] for example.
Can QColor be used as an array like this, does it have the correct default ctor?