From 941a302c4d6ec2219f235b85a73f7023de05ce0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 25 Apr 2024 20:03:19 +0200 Subject: [PATCH] Ensure editor preview image and sound are unloaded properly The preview image was previously not unloaded and the preview state was not reset. --- src/game/editor/editor.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 226401461..0a20304c2 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -8710,11 +8710,10 @@ void CEditor::OnClose() void CEditor::OnDialogClose() { - if(m_FilePreviewSound >= 0) - { - Sound()->UnloadSample(m_FilePreviewSound); - m_FilePreviewSound = -1; - } + Graphics()->UnloadTexture(&m_FilePreviewImage); + Sound()->UnloadSample(m_FilePreviewSound); + m_FilePreviewSound = -1; + m_FilePreviewState = PREVIEW_UNLOADED; } void CEditor::LoadCurrentMap()