diff --git a/frameworks/animator/animator.cpp b/frameworks/animator/animator.cpp index f10d3a4b4d13b7ee0602eb321e6e7e2b6c133ed1..5d750742bb431b74f6f3d37f8797b1423fce7c8f 100755 --- a/frameworks/animator/animator.cpp +++ b/frameworks/animator/animator.cpp @@ -61,6 +61,10 @@ void Animator::Run() runTime_ = (UINT32_MAX - elapse > runTime_) ? (runTime_ + elapse) : period_; if (!repeat_ && (runTime_ >= period_)) { + runTime_ = period_; + if (callback_ != nullptr) { + callback_->Callback(view_); + } Stop(); return; } diff --git a/frameworks/animator/animator_manager.cpp b/frameworks/animator/animator_manager.cpp index f2af9c26a871c34df33b3dc02cc6bac2d8f56c82..fe7832483b5995160aed95a8226effeb739132c1 100644 --- a/frameworks/animator/animator_manager.cpp +++ b/frameworks/animator/animator_manager.cpp @@ -56,7 +56,7 @@ void AnimatorManager::Remove(const Animator* animator) ListNode* pos = list_.Begin(); while (pos != list_.End()) { if (pos->data_ == animator) { - list_.Remove(pos); + pos->data_ = nullptr; return; } pos = pos->next_; @@ -70,10 +70,15 @@ void AnimatorManager::AnimatorTask() while (pos != list_.End()) { animator = pos->data_; - pos = pos->next_; + if (animator == nullptr) { + // clean up animator list + pos = list_.Remove(pos); + continue; + } if (animator->GetState() == Animator::START) { animator->Run(); } + pos = pos->next_; } } } // namespace OHOS diff --git a/frameworks/engines/gfx/gfx_engine_manager.cpp b/frameworks/engines/gfx/gfx_engine_manager.cpp index 0f45a0674d7a0b9e87880bfada7d1687fa425420..3d13665af6d4075ff02fadad20d18ee23cb85fec 100644 --- a/frameworks/engines/gfx/gfx_engine_manager.cpp +++ b/frameworks/engines/gfx/gfx_engine_manager.cpp @@ -14,6 +14,9 @@ */ #include "engines/gfx/gfx_engine_manager.h" + +#include + #include "draw/draw_arc.h" #include "draw/draw_curve.h" #include "draw/draw_line.h"