提交 1e5e1477 编写于 作者: W wangtiantian 提交者: Gitee

回退 'Pull Request !203 : GetOrigRect函数调用会出现空指针异常'

上级 23bd067e
......@@ -35,10 +35,7 @@ UIViewGroup::UIViewGroup()
#endif
}
UIViewGroup::~UIViewGroup()
{
RemoveAllChildren();
}
UIViewGroup::~UIViewGroup() {}
void UIViewGroup::Add(UIView* view)
{
......@@ -146,7 +143,17 @@ void UIViewGroup::Remove(UIView* view)
void UIViewGroup::RemoveAll()
{
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);
}
OnChildChanged();
}
......@@ -291,19 +298,4 @@ 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,7 +286,6 @@ 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.
先完成此消息的编辑!
想要评论请 注册