diff --git a/modules/core/misc/java/src/java/core+Mat.java b/modules/core/misc/java/src/java/core+Mat.java index 6db255417c..4fd60a79c6 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() {