From 4587e5a1482ecc60c51502472b4d0df3b1de2221 Mon Sep 17 00:00:00 2001 From: Nomango Date: Sat, 17 Oct 2020 01:12:09 +0800 Subject: [PATCH] [deploy] fix: Actor::RemoveAllChildren not work --- src/kiwano/2d/Actor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kiwano/2d/Actor.cpp b/src/kiwano/2d/Actor.cpp index caa9dfad..9ea6b578 100644 --- a/src/kiwano/2d/Actor.cpp +++ b/src/kiwano/2d/Actor.cpp @@ -611,7 +611,12 @@ void Actor::RemoveChildren(const String& child_name) void Actor::RemoveAllChildren() { - children_.Clear(); + ActorPtr next; + for (ActorPtr child = children_.GetFirst(); child; child = next) + { + next = child->GetNext(); + RemoveChild(child); + } } bool Actor::ContainsPoint(const Point& point) const