From 5a93c7b474b91e48d92bf37c6daeeef69460110e Mon Sep 17 00:00:00 2001 From: TadejZupancic Date: Thu, 4 Oct 2018 15:38:46 +0200 Subject: [PATCH] Tween inside Timeline fix The stop method in Tween assumed, that tween's parent was TweenManager. If the Tween has been added to the Timeline, that was not true and the stop method crashed. --- src/tweens/tween/Tween.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tweens/tween/Tween.js b/src/tweens/tween/Tween.js index f169c59fc..5cdb474fb 100644 --- a/src/tweens/tween/Tween.js +++ b/src/tweens/tween/Tween.js @@ -901,8 +901,16 @@ var Tween = new Class({ { if (this.state === TWEEN_CONST.PAUSED || this.state === TWEEN_CONST.PENDING_ADD) { - this.parent._destroy.push(this); - this.parent._toProcess++; + if (this.parentIsTimeline) + { + this.parent.manager._destroy.push(this); + this.parent.manager._toProcess++; + } + else + { + this.parent._destroy.push(this); + this.parent._toProcess++; + } } this.state = TWEEN_CONST.PENDING_REMOVE;