Don't call `jni_YGNodeFree` as fast native method

Summary:
@public

If `jni_YGNodeFree` is called while GC is running, the weak reference table lock is held by the GC, leading to deadlock.

Here, we revert the method to being a regular native method, solving that problem.

Reviewed By: SidharthGuglani

Differential Revision: D14184220

fbshipit-source-id: 2882fa10586617cea2df99550a7dd8885376d11e
This commit is contained in:
David Aurelio 2019-02-22 08:56:40 -08:00 коммит произвёл Facebook Github Bot
Родитель 81860c59c3
Коммит c3522a017d
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -376,7 +376,7 @@ jlong jni_YGNodeClone(
return reinterpret_cast<jlong>(clonedYogaNode);
}
void jni_YGNodeFree(jlong nativePointer) {
void jni_YGNodeFree(alias_ref<jclass>, jlong nativePointer) {
if (nativePointer == 0) {
return;
}
@ -728,7 +728,7 @@ jint JNI_OnLoad(JavaVM* vm, void*) {
{
YGMakeNativeMethod(jni_YGNodeNew),
YGMakeNativeMethod(jni_YGNodeNewWithConfig),
YGMakeCriticalNativeMethod(jni_YGNodeFree),
YGMakeNativeMethod(jni_YGNodeFree),
YGMakeCriticalNativeMethod(jni_YGNodeReset),
YGMakeCriticalNativeMethod(jni_YGNodeClearChildren),
YGMakeCriticalNativeMethod(jni_YGNodeInsertChild),