]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
made the pdf renderer reusable (eg. how cocoon uses it)
authorKeiron Liddle <keiron@apache.org>
Thu, 23 Aug 2001 06:14:33 +0000 (06:14 +0000)
committerKeiron Liddle <keiron@apache.org>
Thu, 23 Aug 2001 06:14:33 +0000 (06:14 +0000)
prevents it creating invalid documents
frees up memory

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194440 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/render/pdf/PDFRenderer.java

index d411ceecdac9df5c79a57f0d5961d90847c42df4..6cec91dd0aaacf0c7942d452142b8175142a29ba 100644 (file)
@@ -157,6 +157,15 @@ public class PDFRenderer extends PrintRenderer {
         renderRootExtensions(extensions);
         FontSetup.addToResources(this.pdfDoc, fontInfo);
         pdfDoc.outputTrailer(stream);
+
+        // this frees up memory and makes the renderer reusable
+        this.pdfDoc = new PDFDocument();
+        this.pdfResources = null;
+        extensions = null;
+        currentStream = null;
+        currentAnnotList = null;
+        currentPage = null;
+        currentColor = null;
     }
 
     /**