!538 【代码同步】修复RemoveChild异常的问题

Merge pull request !538 from 郝烁/cherry-pick-1650873755
This commit is contained in:
openharmony_ci
2022-04-26 03:58:07 +00:00
committed by Gitee
2 changed files with 4 additions and 8 deletions
+1 -5
View File
@@ -1746,11 +1746,7 @@ void Component::RemoveChild(Component *childNode)
return;
}
// the head itself is the last one
if (temp == childHead_) {
childHead_ = nullptr;
}
temp->SetNextSibling(nullptr);
temp->SetNextSibling(childNode->GetNextSibling());
childNode->SetNextSibling(nullptr);
childNode->SetParent(nullptr);
parentView->Remove(childNativeView);
+3 -3
View File
@@ -184,17 +184,17 @@ public:
virtual void LayoutChildren() {}
static void BuildViewTree(Component *currComponent, Component *parent, ConstrainedParameter &parentParameter);
const Component *GetParent() const
Component *GetParent() const
{
return parent_;
}
const Component *GetChildHead() const
Component *GetChildHead() const
{
return childHead_;
}
const Component *GetNextSibling() const
Component *GetNextSibling() const
{
return nextSibling_;
}