diff --git a/langkit/templates/java_api/main_class.mako b/langkit/templates/java_api/main_class.mako index 2e3ec7899..271d8e9e2 100644 --- a/langkit/templates/java_api/main_class.mako +++ b/langkit/templates/java_api/main_class.mako @@ -4260,7 +4260,7 @@ public final class ${ctx.lib_name.camel} { } // Free the native array - UnmanagedMemory.free(unitArrayNative); + NI_LIB.${nat("free")}(unitArrayNative); // Return the Java list as an array return resList.toArray(new RewritingUnit[0]); @@ -4835,7 +4835,7 @@ public final class ${ctx.lib_name.camel} { } // Free the native children - UnmanagedMemory.free(children); + NI_LIB.${nat("free")}(children); // Return the result return res;