Permalink
Browse files

Add API to reset CxxModuleWrapper's module pointer

Reviewed By: mhorowitz

Differential Revision: D4914335

fbshipit-source-id: f28f57c2e74d590dacfb85d8027747837f768fdc
  • Loading branch information...
javache authored and facebook-github-bot committed Apr 20, 2017
1 parent db8efd9 commit 17020ff9af5648aeb5b45314e4fca7cb2c9352b1
@@ -2,7 +2,6 @@
package com.facebook.react.cxxbridge;
import java.util.Map;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
@@ -52,4 +51,12 @@ public void onCatalystInstanceDestroy() {
protected CxxModuleWrapperBase(HybridData hd) {
mHybridData = hd;
}
// Replace the current native module held by this wrapper by a new instance
protected void resetModule(HybridData hd) {
if (hd != mHybridData) {
mHybridData.resetNative();
mHybridData = hd;
}
}
}

0 comments on commit 17020ff

Please sign in to comment.