Jelajahi Sumber

Bugfix: Clearing a GUI layout will no longer destroy the child GUI elements if their reference is also held somewhere else

BearishSun 8 tahun lalu
induk
melakukan
23cbfddd23
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      Source/SBansheeEngine/Wrappers/GUI/BsScriptGUILayout.cpp

+ 2 - 2
Source/SBansheeEngine/Wrappers/GUI/BsScriptGUILayout.cpp

@@ -195,10 +195,10 @@ namespace bs
 
 		for (auto& child : instance->mChildren)
 		{
-			MonoUtil::freeGCHandle(child.gcHandle);
+			instance->getInternalValue()->removeElement(child.element->getGUIElement());
 
+			MonoUtil::freeGCHandle(child.gcHandle);
 			child.element->setParent(nullptr);
-			child.element->destroy();
 		}
 
 		instance->mChildren.clear();