DarkRadiant: master a1f0c789

Author Committer Branch Timestamp Parent
orbweaver orbweaver master 04.01.2023 20:25 master f3f3f9d3
Affected Issues  0006216: Light Inspector crashes on Linux
Changeset 0006216: fix crash on showing Light Inspector

Crash was caused by a race condition initialising the _texSelector
member of LightInspector. This member stores a pointer to a
MaterialSelector, but the MaterialSelector constructor itself was
triggering a callback to shaderSelectionChanged() which found a null
_texSelector since the assignment hadn't happened yet.

MaterialSelector no longer accepts a std::function callback in its
constructor, but instead exposes a sigc::signal which client code can
connect to. This automatically avoids any future race condition because
nothing can access or connect to the signal until the MaterialSelector
has been fully constructed.
mod - radiant/ui/lightinspector/LightInspector.cpp Diff File
mod - radiant/ui/materials/MaterialChooser.cpp Diff File
mod - radiant/ui/materials/MaterialSelector.cpp Diff File
mod - radiant/ui/materials/MaterialSelector.h Diff File