修复Paddle内存泄露的问题

This commit is contained in:
TonyJiangWJ 2022-02-05 02:17:42 +08:00
parent fcc5f19237
commit 375ad67239

View File

@ -58,7 +58,7 @@ public class OCRPredictorNative {
}
public void destory(){
if (nativePointer > 0) {
if (nativePointer != 0) {
release(nativePointer);
nativePointer = 0;
}
@ -102,5 +102,9 @@ public class OCRPredictorNative {
return model;
}
@Override
protected void finalize() throws Throwable {
super.finalize();
destory();
}
}