Просмотр исходного кода

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

BearishSun 8 лет назад
Родитель
Сommit
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)
 		{
-			MonoUtil::freeGCHandle(child.gcHandle);
+			instance->getInternalValue()->removeElement(child.element->getGUIElement());
 
+			MonoUtil::freeGCHandle(child.gcHandle);
 			child.element->setParent(nullptr);
-			child.element->destroy();
 		}
 
 		instance->mChildren.clear();