Description: fix bug in func RemoveChild

IssueNo: https://gitee.com/openharmony/ace_engine_lite/issues/I54FS6
Feature or Bugfix: Bugfix
Binary Source:No
Signed-off-by: lancer <haoshuo@huawei.com>
This commit is contained in:
lancer
2022-04-24 19:53:44 +08:00
parent 77d4f3932d
commit 62fda2ab3e
2 changed files with 4 additions and 8 deletions
+1 -5
View File
@@ -1748,11 +1748,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_;
}