From 3e64a227e5392ec5752ab7f0471d7c054da742c1 Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 9 Oct 2021 21:48:43 +0200 Subject: [PATCH] Fix Object Selection not freeing the object when unhovering Fixes a double-free on previews. --- src/openrct2-ui/windows/EditorObjectSelection.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 14222f5dc3..81957c73f9 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -757,7 +757,10 @@ static void window_editor_object_selection_scroll_mouseover( w->selected_list_item = selectedObject; if (_loadedObject != nullptr) + { _loadedObject->Unload(); + _loadedObject = nullptr; + } if (selectedObject == -1) {