Permalink
Browse files

don't call clearFrameCallback() if we don't have a ReactChoreographer…

… to clear the frame callback on

Reviewed By: achen1

Differential Revision: D4741906

fbshipit-source-id: 2d5fabab6e04c08252513f77149c04e3b8314d2c
  • Loading branch information...
AaaChiuuu authored and facebook-github-bot committed Mar 21, 2017
1 parent 68c655a commit ba75d9903368e90b5c7a9b61e222609b5ac9acb7
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Callback;
@@ -70,10 +71,12 @@
* isolates us from the problems that may be caused by concurrent updates of animated graph while UI
* thread is "executing" the animation loop.
*/
@ReactModule(name = "NativeAnimatedModule")
@ReactModule(name = NativeAnimatedModule.NAME)
public class NativeAnimatedModule extends ReactContextBaseJavaModule implements
OnBatchCompleteListener, LifecycleEventListener {
protected static final String NAME = "NativeAnimatedModule";
private interface UIThreadOperation {
void execute(NativeAnimatedNodesManager animatedNodesManager);
}
@@ -159,6 +162,10 @@ public void onBatchComplete() {
@Override
public void onHostPause() {
if (mReactChoreographer == null) {
FLog.e(NAME, "Called NativeAnimated.onHostPause() with a null ReactChoreographer.");
return;
}
clearFrameCallback();
}
@@ -169,7 +176,7 @@ public void onHostDestroy() {
@Override
public String getName() {
return "NativeAnimatedModule";
return NAME;
}
private void clearFrameCallback() {

0 comments on commit ba75d99

Please sign in to comment.