Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[core] delete child node when delete parent node
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhan-he committed Jan 3, 2019
1 parent 524c455 commit 36781e0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions weex_core/Source/core/data_render/vnode/vnode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ VNode::~VNode() {
delete events_;
events_ = nullptr;
}
// for (auto it = child_list_.begin(); it != child_list_.end(); it++) {
// VNode *&reference = *it;
// if (reference != nullptr) {
// delete reference;
// *it = nullptr;
// }
// }
for (auto it = child_list_.begin(); it != child_list_.end(); it++) {
VNode *&reference = *it;
if (reference != nullptr) {
delete reference;
*it = nullptr;
}
}
}

void VNode::OnEvent(const std::string &event, const std::string args,
Expand Down

0 comments on commit 36781e0

Please sign in to comment.