Browse Source

Animation: Fixed memory leak in .removeAction.

tschw 9 years ago
parent
commit
11e0d0655b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/animation/AnimationMixer.js

+ 5 - 2
src/animation/AnimationMixer.js

@@ -159,9 +159,10 @@ THREE.AnimationMixer.prototype = {
 		}
 		}
 
 
 		// unreference all property mixers
 		// unreference all property mixers
-		var uuid = ( action.localRoot || this.root ).uuid,
+		var interpolants = action._interpolants,
 			actionBindings = action._propertyBindings,
 			actionBindings = action._propertyBindings,
-			bindings = this._bindingsMaps[ uuid ],
+			rootUuid = ( action.localRoot || this.root ).uuid,
+			bindings = this._bindingsMaps[ rootUuid ],
 
 
 			bindingsChanged = false;
 			bindingsChanged = false;
 
 
@@ -170,6 +171,8 @@ THREE.AnimationMixer.prototype = {
 			var propertyMixer = actionBindings[ i ];
 			var propertyMixer = actionBindings[ i ];
 			actionBindings[ i ] = null;
 			actionBindings[ i ] = null;
 
 
+			interpolants[ i ].result = null;
+
 			// eventually remove the binding from the array
 			// eventually remove the binding from the array
 			if( -- propertyMixer.referenceCount === 0 ) {
 			if( -- propertyMixer.referenceCount === 0 ) {