From d6027a111a6355e265ff8f3aca0b8d69694093cd Mon Sep 17 00:00:00 2001 From: Josh Trzebiatowski Date: Mon, 23 Jan 2023 23:55:31 -0600 Subject: [PATCH] Fix #19250: MusicObjects do not free their preview images (#19264) * Fix: MusicObjects do not free their preview images * Update changelog * remove unneeded preview check on MusicObject --- distribution/changelog.txt | 1 + src/openrct2/object/MusicObject.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 26d17a558b..a9162ffbdc 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -26,6 +26,7 @@ - Fix: [#19112] Text boxes not updated with empty strings in Track List, Server List, and Start Server windows. - Fix: [#19114] [Plugin] GameActionResult does not comply to API specification. - Fix: [#19136] SV6 saves with experimental RCT1 paths not imported correctly. +- Fix: [#19250] MusicObjects do not free their preview images 0.4.3 (2022-12-14) ------------------------------------------------------------------------ diff --git a/src/openrct2/object/MusicObject.cpp b/src/openrct2/object/MusicObject.cpp index 90fc137b28..56ba4fa2a2 100644 --- a/src/openrct2/object/MusicObject.cpp +++ b/src/openrct2/object/MusicObject.cpp @@ -80,6 +80,10 @@ void MusicObject::Load() void MusicObject::Unload() { LanguageFreeObjectString(NameStringId); + GfxObjectFreeImages(_previewImageId, GetImageTable().GetCount()); + + _hasPreview = false; + _previewImageId = 0; NameStringId = 0; }