From 10fb74db8a270e20e36950447fc72069095db961 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 d4c2204591..3d1ee2a58a 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 7b33d48c04..2e7e16f3ed 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(); } } } -- 2.39.5