From fb8cadeceafc23f7d34bf96229ca363e29cdb437 Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Thu, 12 May 2016 17:36:52 +0800 Subject: [PATCH] stop animation on destroy --- cocos2d/core/components/CCAnimation.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos2d/core/components/CCAnimation.js b/cocos2d/core/components/CCAnimation.js index c707ab6985..a2269948dd 100644 --- a/cocos2d/core/components/CCAnimation.js +++ b/cocos2d/core/components/CCAnimation.js @@ -165,6 +165,10 @@ var Animation = cc.Class({ this.pause(); }, + onDestroy: function () { + this.stop(); + }, + /////////////////////////////////////////////////////////////////////////////// // Public Methods ///////////////////////////////////////////////////////////////////////////////