From dbbd5b89e630ed238b209d8becee6c3742c6b67f Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 4 May 2018 20:24:35 +0100 Subject: [PATCH] Fix assert in SDL2 (debug) --- src/openrct2-ui/UiContext.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 33980bfc9a..e652f041de 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -550,8 +550,11 @@ public: void CloseWindow() override { drawing_engine_dispose(); - SDL_DestroyWindow(_window); - _window = nullptr; + if (_window != nullptr) + { + SDL_DestroyWindow(_window); + _window = nullptr; + } } void RecreateWindow() override