Fix crash when using audio playback and playing editor meanwhile

This commit is contained in:
Wojtek Figat
2025-03-11 18:10:48 +01:00
parent a3cc3c79e2
commit 3c303514a4
4 changed files with 13 additions and 1 deletions

View File

@@ -606,6 +606,11 @@ void ManagedEditor::WipeOutLeftoverSceneObjects()
{
if (sceneObject->HasParent())
continue; // Skip sub-objects
auto* actor = Cast<Actor>(sceneObject);
if (!actor)
actor = sceneObject->GetParent();
if (actor && actor->HasTag(TEXT("__EditorInternal")))
continue; // Skip internal objects used by Editor (eg. EditorScene)
LOG(Error, "Object '{}' (ID={}, Type={}) is still in memory after play end but should be destroyed (memory leak).", sceneObject->GetNamePath(), sceneObject->GetID(), sceneObject->GetType().ToString());
sceneObject->DeleteObject();