Skip to content

Commit 68cebb0

Browse files
committed
fix(UIManager): 在关闭UI时移除组件并释放资源
在销毁UI组件时,确保先将其从父节点移除并清理组件,再执行释放操作,避免潜在的内存泄漏问题
1 parent 38b642e commit 68cebb0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Runtime/UIManager.Close.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ protected override void RecycleUIForm(IUIForm uiForm, bool isDispose = false)
6767

6868
if (isDispose)
6969
{
70+
component.RemoveFromParent();
71+
component.Remove();
7072
component.Dispose();
7173
}
7274
}

0 commit comments

Comments
 (0)