2019-10-15 10:30:08 -07:00
|
|
|
/*
|
2021-12-30 15:08:43 -08:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2019-09-18 00:36:26 -07:00
|
|
|
*
|
2019-10-15 10:30:08 -07:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2019-09-18 00:36:26 -07:00
|
|
|
*/
|
2019-10-15 10:30:08 -07:00
|
|
|
|
2019-09-18 00:36:26 -07:00
|
|
|
package com.facebook.yoga;
|
|
|
|
|
|
|
|
public class YogaConfigJNIFinalizer extends YogaConfigJNIBase {
|
|
|
|
public YogaConfigJNIFinalizer() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void finalize() throws Throwable {
|
|
|
|
try {
|
|
|
|
freeNatives();
|
|
|
|
} finally {
|
|
|
|
super.finalize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void freeNatives() {
|
|
|
|
if (mNativePointer != 0) {
|
|
|
|
long nativePointer = mNativePointer;
|
|
|
|
mNativePointer = 0;
|
2019-11-13 15:13:02 -08:00
|
|
|
YogaNative.jni_YGConfigFreeJNI(nativePointer);
|
2019-09-18 00:36:26 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|