فهرست منبع

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

BearishSun 8 سال پیش
والد
کامیت
23cbfddd23
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  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)
 		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->setParent(nullptr);
-			child.element->destroy();
 		}
 		}
 
 
 		instance->mChildren.clear();
 		instance->mChildren.clear();