From f86b9b93e83087c26070bf761b12bc3d50b898b2 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 16 Jan 2024 18:24:02 +0100 Subject: [PATCH] Fix crash when SDL context fails to create --- source/Irrlicht/CIrrDeviceSDL.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 05f3888b..d56e2ca8 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -265,8 +265,10 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param) // create window if (CreationParams.DriverType != video::EDT_NULL) { - // create the window, only if we do not use the null device - createWindow(); + if (!createWindow()) { + Close = true; + return; + } }