From 88e8b056fcd143d76e57fc0dfc9a0b138f1bbafe Mon Sep 17 00:00:00 2001 From: Maxim Valyanskiy Date: Tue, 16 Nov 2010 12:45:39 +0000 Subject: [PATCH] XWPF: dispose xml cursor when iteration over it is done git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1035615 13f79535-47bb-0310-9956-ffa450edef68 --- src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java | 1 + src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java index d4c220459..3d1ee2a58 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java @@ -155,6 +155,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody { tables.add(t); } } + cursor.dispose(); // Sort out headers and footers if (doc.getDocument().getBody().getSectPr() != null) diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java index 7b33d48c0..2e7e16f3e 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java @@ -140,6 +140,7 @@ public class XWPFParagraph implements IBodyElement{ footnoteText.append("]"); } } + c.dispose(); } } }