You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Glen Peterson (JIRA)" <ji...@apache.org> on 2018/06/07 17:29:00 UTC

[jira] [Created] (PDFBOX-4242) Fontbox does not close file descriptor when loading fonts.

Glen Peterson created PDFBOX-4242:
-------------------------------------

             Summary: Fontbox does not close file descriptor when loading fonts.
                 Key: PDFBOX-4242
                 URL: https://issues.apache.org/jira/browse/PDFBOX-4242
             Project: PDFBox
          Issue Type: Bug
          Components: FontBox
    Affects Versions: 2.0.9
            Reporter: Glen Peterson


My app has been getting "java.io.FileNotFoundException (No file descriptors available)" and I think it's because fontbox isn't closing it's file descriptors.

In org.apache.fontbox.ttf.TTFParser there's this method:

{{public TrueTypeFont parse(File ttfFile) throws IOException {}}
{{  RAFDataStream raf = new RAFDataStream(ttfFile, "r");try {}}
{{    return this.parse((TTFDataStream)raf);}}
{{  } catch (IOException var4) {}}{{    // close only on error (file is still being accessed later)}}
{{    raf.close();}}
{{    throw var4;}}
{{  }}}
{{ }}}

I think 

{{public TrueTypeFont parse(File ttfFile) throws IOException {}}
{{  RAFDataStream raf = new RAFDataStream(ttfFile, "r");try {}}
{{    return this.parse((TTFDataStream)raf);}}
{{  } catch (IOException var4) {}}{{    raf.close();}}
{{    throw var4;}}
{{  } finally {}}{{    raf.close();}}{{     }}}
{{}}}

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org