aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/intermediate
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2013-03-19 16:21:15 +0000
committerVincent Hennebert <vhennebert@apache.org>2013-03-19 16:21:15 +0000
commite3c9f13598dc3bbcbe1ea34920972910625567c0 (patch)
tree0c18e0a4be3dd7fe0b10c2de71d6060fcd400949 /src/java/org/apache/fop/render/intermediate
parent92a5ef654877571635164b70e5c211e9dc0cc740 (diff)
downloadxmlgraphics-fop-e3c9f13598dc3bbcbe1ea34920972910625567c0.tar.gz
xmlgraphics-fop-e3c9f13598dc3bbcbe1ea34920972910625567c0.zip
FOP-2226: Image resources are not closed when rendering into the Intermediate Format
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1458382 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/intermediate')
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFSerializer.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
index 0a20437c0..ff3f761bf 100644
--- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java
+++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
@@ -34,6 +34,8 @@ import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
+import org.apache.xmlgraphics.image.loader.ImageManager;
+import org.apache.xmlgraphics.image.loader.ImageSessionContext;
import org.apache.xmlgraphics.util.QName;
import org.apache.xmlgraphics.util.XMLizable;
@@ -466,6 +468,10 @@ implements IFConstants, IFPainter, IFDocumentNavigationHandler {
handler.element(EL_IMAGE, atts);
} catch (SAXException e) {
throw new IFException("SAX error in startGroup()", e);
+ } finally {
+ ImageSessionContext session = getUserAgent().getImageSessionContext();
+ ImageManager imageManager = getUserAgent().getImageManager();
+ imageManager.closeImage(uri, session);
}
}