From 17841ca8a22f54ad15d23057b6fc251c88a9ca7f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 10 Oct 2022 00:12:20 +0200 Subject: [PATCH] GUI: Fix crash on switch SDL Surface -> OpenGL --- gui/options.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui/options.cpp b/gui/options.cpp index 243706dd9c5..8f20ff2cb0b 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -1903,6 +1903,11 @@ void OptionsDialog::reflowLayout() { void OptionsDialog::setupGraphicsTab() { if (_graphicsTabId != -1) { + // Since we do not create shader controls, the rebuild is required + // Fixes crash when switching from SDL Surface to OpenGL + if (!_shader && g_system->hasFeature(OSystem::kFeatureShaders)) { + rebuild(); + } setGraphicSettingsState(_enableGraphicSettings); } if (!_fullscreenCheckbox)