diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2015-11-18 09:30:05 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2015-11-19 09:03:52 +0100 |
commit | 2a93094bb440c354d5b9dda20890bc537d305ba2 (patch) | |
tree | bd3ffa8e0ddf70a072562d271a7e3902261e3fdd /pdf-as-pdfbox/src/main | |
parent | 4cd769dfdf1133b61935f042e3897c3980f6327b (diff) | |
download | pdf-as-4-2a93094bb440c354d5b9dda20890bc537d305ba2.tar.gz pdf-as-4-2a93094bb440c354d5b9dda20890bc537d305ba2.tar.bz2 pdf-as-4-2a93094bb440c354d5b9dda20890bc537d305ba2.zip |
protect PDDocument loading, for multithreading
Diffstat (limited to 'pdf-as-pdfbox/src/main')
-rw-r--r-- | pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/PDFBOXObject.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/PDFBOXObject.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/PDFBOXObject.java index ef4c055c..d3babcb2 100644 --- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/PDFBOXObject.java +++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/PDFBOXObject.java @@ -47,7 +47,9 @@ public class PDFBOXObject extends PDFObject { if(doc != null) { doc.close(); } - this.doc = PDDocument.load(this.originalDocument.getInputStream()); + synchronized(PDDocument.class) { + this.doc = PDDocument.load(this.originalDocument.getInputStream()); + } if(this.doc != null) { this.doc.getDocument().setWarnMissingClose(false); } |