releasing native memory of temp Mat objects in generated Java code

This commit is contained in:
Andrey Pavlenko 2015-05-26 13:50:56 +03:00
parent 5b00d9da49
commit 72ec9c159e

View File

@ -1153,6 +1153,7 @@ extern "C" {
if "O" in a.out: if "O" in a.out:
if not type_dict[a.ctype]["j_type"].startswith("MatOf"): if not type_dict[a.ctype]["j_type"].startswith("MatOf"):
j_epilogue.append("Converters.Mat_to_%(t)s(%(n)s_mat, %(n)s);" % {"t" : a.ctype, "n" : a.name}) j_epilogue.append("Converters.Mat_to_%(t)s(%(n)s_mat, %(n)s);" % {"t" : a.ctype, "n" : a.name})
j_epilogue.append( "%s_mat.release();" % a.name )
c_epilogue.append( "%(t)s_to_Mat( %(n)s, %(n)s_mat );" % {"n" : a.name, "t" : a.ctype} ) c_epilogue.append( "%(t)s_to_Mat( %(n)s, %(n)s_mat );" % {"n" : a.name, "t" : a.ctype} )
else: else:
fields = type_dict[a.ctype].get("jn_args", ((a.ctype, ""),)) fields = type_dict[a.ctype].get("jn_args", ((a.ctype, ""),))