From 0e518c52a953da2023a4fef789ff175ea89dd565 Mon Sep 17 00:00:00 2001 From: Diren D Bharwani Date: Sun, 2 Oct 2022 04:22:32 +0800 Subject: [PATCH] Fixed bug when SceneGraph is destroyed --- SHADE_Engine/src/Scene/SHSceneGraph.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SHADE_Engine/src/Scene/SHSceneGraph.cpp b/SHADE_Engine/src/Scene/SHSceneGraph.cpp index da2dcffd..60f0794d 100644 --- a/SHADE_Engine/src/Scene/SHSceneGraph.cpp +++ b/SHADE_Engine/src/Scene/SHSceneGraph.cpp @@ -312,6 +312,11 @@ namespace SHADE if (parentNode == nullptr) { SHLOG_WARNING("Removing Entity {}'s parent", entityID) + + if (parent) + parent->RemoveChild(this); + + return; } // Handle self assignment