提交 e0e397ef 编写于 作者: W wangtiantian

IssueNo:#I3UVC5

Description:fix bug
Sig:graphic
Feature or Bugfix:Bugfix
Binary Source:No
Signed-off-by: Nwangtiantian <wang_thinking@163.com>
上级 3b8e68eb
......@@ -35,7 +35,10 @@ UIViewGroup::UIViewGroup()
#endif
}
UIViewGroup::~UIViewGroup() {}
UIViewGroup::~UIViewGroup()
{
RemoveAllChildren();
}
void UIViewGroup::Add(UIView* view)
{
......@@ -143,17 +146,7 @@ void UIViewGroup::Remove(UIView* view)
void UIViewGroup::RemoveAll()
{
UIView* node = childrenHead_;
childrenHead_ = nullptr;
childrenTail_ = nullptr;
childrenNum_ = 0;
UIView* tmp = nullptr;
while (node != nullptr) {
tmp = node;
node = node->GetNextSibling();
tmp->SetParent(nullptr);
tmp->SetNextSibling(nullptr);
}
RemoveAllChildren();
OnChildChanged();
}
......@@ -298,4 +291,19 @@ void UIViewGroup::AutoResize()
SetWidth(rect.GetWidth() + rect.GetLeft());
SetHeight(rect.GetHeight() + rect.GetTop());
}
void UIViewGroup::RemoveAllChildren()
{
UIView* node = childrenHead_;
childrenHead_ = nullptr;
childrenTail_ = nullptr;
childrenNum_ = 0;
UIView* tmp = nullptr;
while (node != nullptr) {
tmp = node;
node = node->GetNextSibling();
tmp->SetParent(nullptr);
tmp->SetNextSibling(nullptr);
}
}
} // namespace OHOS
......@@ -286,6 +286,7 @@ protected:
private:
void AutoResize();
void RemoveAllChildren();
#if ENABLE_FOCUS_MANAGER
bool isInterceptFocus_ : 1;
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册