[PATCH] Option to disable close warning in finalizer of COSDocument.
--------------------------------------------------------------------

                 Key: PDFBOX-507
                 URL: https://issues.apache.org/jira/browse/PDFBOX-507
             Project: PDFBox
          Issue Type: Improvement
    Affects Versions: 0.8.0-incubator
            Reporter: Jeremias Maerki
             Fix For: 0.8.0-incubator
         Attachments: COSDocumentFinalizerPatch.diff

I'm using PDFBox in a FOP plug-in to embed PDF documents. The PDF images are 
cached in memory through soft references. Therefore I do not know exactly when 
the COSDocument needs to be closed. I do close it in the holder's finalize() 
method but the garbage collector sometimes calls the COSDocument's finalizer 
before I have a chance to close it myself. With this patch I'd like to 
introduce an option that lets me disable the warning and do a close() in the 
finalizer in any case. I do think that the warning can be helpful for newbies 
(closing early is a good idea when that's possible) but the warning to 
System.err is a problem in my case.

If noone objects within 72 hours, I'm happy to apply the patch myself.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to