From 518179555d5501811eb90156469977101e84d530 Mon Sep 17 00:00:00 2001 From: "Flavio S. Glock" Date: Wed, 29 Oct 2025 17:44:31 +0100 Subject: [PATCH] Add DESTROY method to IO::Handle FileHandle.pm expects to import IO::Handle::DESTROY, but it wasn't defined. Added an empty DESTROY method to satisfy this requirement. The actual cleanup happens in Java when the JVM garbage collects the object. Fixes: t/op/filehandle.t (4/4 tests now pass) --- src/main/perl/lib/IO/Handle.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/perl/lib/IO/Handle.pm b/src/main/perl/lib/IO/Handle.pm index 9d080861f..5ad204230 100644 --- a/src/main/perl/lib/IO/Handle.pm +++ b/src/main/perl/lib/IO/Handle.pm @@ -449,6 +449,13 @@ sub untaint { return -1; } +# DESTROY method - called when handle is being destroyed +# In PerlOnJava, this is called by JVM garbage collector +sub DESTROY { + # Empty DESTROY is fine - the actual cleanup happens in Java + # This just needs to exist so FileHandle can import it +} + 1; __END__