Skip to content

Commit

Permalink
Prevent Generator from requiring destructors for downcast constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Nov 11, 2023
1 parent 78f0203 commit 2d03a8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/bytedeco/javacpp/tools/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2875,9 +2875,12 @@ void returnAfter(MethodInformation methodInfo) {
} else if (methodInfo.arrayAllocator) {
out.println("&JavaCPP_" + mangle(methodInfo.cls.getName()) + "_deallocateArray);");
arrayDeallocators.index(methodInfo.cls);
} else {
} else if (!methodInfo.method.isAnnotationPresent(Name.class)) {
out.println("&JavaCPP_" + mangle(methodInfo.cls.getName()) + "_deallocate);");
deallocators.index(methodInfo.cls);
} else {
// downcast constructor
out.println("NULL);");
}
}
if (virtualFunctions.containsKey(methodInfo.cls)) {
Expand Down

0 comments on commit 2d03a8d

Please sign in to comment.