fix NativeAnimated event listener bug

Summary:
This bugfix cleans up reference to value listener upon unsubscribing to native events ultimately preventing RCTEventEmitter from throwing a [listener count error](https://github.com/facebook/react-native/blob/v0.33.0-rc.0/React/Modules/RCTEventEmitter.m#L90):

`Attempted to remove more RCTNativeAnimatedModule listeners than added`

/cc janicduplessis sahrens

🍺
Closes https://github.com/facebook/react-native/pull/9729

Differential Revision: D3818241

Pulled By: sahrens

fbshipit-source-id: e235e3f97534ef2a50df29877ce36d3b6095237e
This commit is contained in:
Jake Murzy 2016-09-04 15:51:59 -07:00 committed by Facebook Github Bot 0
parent dcdf16a0fb
commit 64009b61cc
1 changed files with 1 additions and 0 deletions

View File

@ -788,6 +788,7 @@ class AnimatedValue extends AnimatedWithChildren {
}
this.__nativeAnimatedValueListener.remove();
this.__nativeAnimatedValueListener = null;
NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());
}