From 04e6943b2d1d342112acad5d600b0667c900eb5d Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Wed, 16 Apr 2025 21:05:41 +0300 Subject: [PATCH] Fix crash when relative mode was left active on removed window --- Source/Engine/Platform/SDL/SDLWindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Engine/Platform/SDL/SDLWindow.cpp b/Source/Engine/Platform/SDL/SDLWindow.cpp index 1df680de4..3608b8168 100644 --- a/Source/Engine/Platform/SDL/SDLWindow.cpp +++ b/Source/Engine/Platform/SDL/SDLWindow.cpp @@ -231,6 +231,9 @@ SDLWindow::~SDLWindow() if (_window == nullptr) return; + + if (Input::Mouse != nullptr && Input::Mouse->IsRelative(this)) + Input::Mouse->SetRelativeMode(false, this); SDL_StopTextInput(_window); SDL_DestroyWindow(_window);