HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Troubleshooting › Java 6.0_24b07 crashes while in finalize of PD4Device › Re: Re: Java 6.0_24b07 crashes while in finalize of PD4Device
In the actual development branch (and in v370fx2) the method is implemented safe way.
[language=java:1d2yehr4]public void dispose() {
if ( this.pdfWriter != null ) {
this.pdfWriter.close();
this.pdfWriter = null;
}
if ( this.outputStream != null ) {
try {
this.outputStream.close();
this.outputStream = null;
} catch (IOException e) {
}
}
}[/language:1d2yehr4]
(I removed a couple of debug output lines)
But I do not believe a repeating output stream closing may cause VM crash.
As I wrote in the previous post, it crashes by an attempt to instantiate a color profile, extracted from an PNG image. The color profiles are handled by a native DLL, whose error crashes the JVM.