From fe0ce9282a3d0f0280c3d7ab20fbfb872ef05397 Mon Sep 17 00:00:00 2001 From: sgjava Date: Wed, 13 May 2015 13:44:53 -0400 Subject: [PATCH 1/2] Changed delete() modifier to public from protected --- modules/java/generator/gen_java.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/java/generator/gen_java.py b/modules/java/generator/gen_java.py index cbc28484a..eccc54150 100755 --- a/modules/java/generator/gen_java.py +++ b/modules/java/generator/gen_java.py @@ -1530,7 +1530,7 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname # finalize() ci.j_code.write( """ - protected void delete() { + public void delete() { delete(nativeObj); } """ ) From 8b3b2a52f01c38e7c24e245e0d941a8047028722 Mon Sep 17 00:00:00 2001 From: sgjava Date: Wed, 13 May 2015 13:45:19 -0400 Subject: [PATCH 2/2] Removed finalize() and added n_delete to release() --- modules/core/misc/java/src/java/core+Mat.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/core/misc/java/src/java/core+Mat.java b/modules/core/misc/java/src/java/core+Mat.java index 6db255417..4fd60a79c 100644 --- a/modules/core/misc/java/src/java/core+Mat.java +++ b/modules/core/misc/java/src/java/core+Mat.java @@ -640,6 +640,7 @@ public class Mat { { n_release(nativeObj); + n_delete(nativeObj); return; } @@ -906,12 +907,6 @@ public class Mat { return retVal; } - @Override - protected void finalize() throws Throwable { - n_delete(nativeObj); - super.finalize(); - } - // javadoc:Mat::toString() @Override public String toString() {