Ensure editor preview image and sound are unloaded properly

The preview image was previously not unloaded and the preview state was not reset.
This commit is contained in:
Robert Müller 2024-04-25 20:03:19 +02:00
parent 3b0d9cd6c9
commit 941a302c4d

View file

@ -8710,11 +8710,10 @@ void CEditor::OnClose()
void CEditor::OnDialogClose() void CEditor::OnDialogClose()
{ {
if(m_FilePreviewSound >= 0) Graphics()->UnloadTexture(&m_FilePreviewImage);
{
Sound()->UnloadSample(m_FilePreviewSound); Sound()->UnloadSample(m_FilePreviewSound);
m_FilePreviewSound = -1; m_FilePreviewSound = -1;
} m_FilePreviewState = PREVIEW_UNLOADED;
} }
void CEditor::LoadCurrentMap() void CEditor::LoadCurrentMap()