DarkRadiant: master 9c5e880e

Author Committer Branch Timestamp Parent
orbweaver orbweaver master 08.12.2023 14:18 master 715b6180
Affected Issues  0006351: Crash on activating lighting mode in the Model Chooser
Changeset 0006351: fix crash on activating lighting mode in Model Selector

The issue was almost certainly introduced in a99bd537c293fc6eba6, when
(in order to solve an issue with wxWidgets parenting) intialisation of
the ModelSelector was connected to the MainFrameConstructed signal.

This resulted in the ModelSelector and its component preview widget
being constructed before the shared OpenGL context, which in turn meant
that the preview widget's contained OpenGLRenderSystem did not properly
realise the GLPrograms, resulting in the crash when lighting mode was
activated and the non-existent interaction shader was requested.

Rather than make further changes to ModelSelector initialisation timing,
which would be a fragile solution that could easily allow the issue to
recur in future, the OpenGLRenderSystem initialisation has been made
more robust. If there is no shared context at the time of construction,
we now connect to the appropriate signal to ensure construction happens
when the shared context is created, rather than leaving the render
system without any shaders available.
mod - radiantcore/rendersystem/OpenGLRenderSystem.cpp Diff File