move YGSetLogger and YGConfigFree with global ref to vanilla jni

Summary: Move YGSetLogger and YGConfigFree methods to vanilla JNI

Reviewed By: amir-shalem

Differential Revision: D17754999

fbshipit-source-id: 8dfcf1a54e4d54ebf91e38c6513e6a703a40ae92
This commit is contained in:
Sidharth Guglani
2019-10-09 09:26:47 -07:00
committed by Facebook Github Bot
parent 2ef674edd3
commit d6591439d1
4 changed files with 93 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ public abstract class YogaConfigJNIBase extends YogaConfig {
long mNativePointer;
private YogaLogger mLogger;
private boolean useVanillaJNI = false;
protected boolean useVanillaJNI = false;
private YogaConfigJNIBase(long nativePointer) {
if (nativePointer == 0) {
@@ -85,7 +85,10 @@ public abstract class YogaConfigJNIBase extends YogaConfig {
public void setLogger(YogaLogger logger) {
mLogger = logger;
YogaNative.jni_YGConfigSetLogger(mNativePointer, logger);
if (useVanillaJNI)
YogaNative.jni_YGConfigSetLoggerJNI(mNativePointer, logger);
else
YogaNative.jni_YGConfigSetLogger(mNativePointer, logger);
}
public YogaLogger getLogger() {