dispose xml cursor when iteration over it is done (more)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1035947 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maxim Valyanskiy 2010-11-17 08:13:40 +00:00
parent 88e8b056fc
commit e350093be6
9 changed files with 19 additions and 0 deletions

View File

@ -44,6 +44,8 @@ public class DrawingParagraph {
text.append('\n');
}
}
c.dispose();
return text;
}

View File

@ -69,6 +69,8 @@ public class XSLFCommonSlideData {
}
}
}
c.dispose();
}
return out;

View File

@ -1098,6 +1098,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
CTRow row = (CTRow)o;
cursor.toParent();
o = cursor.getObject();
cursor.dispose();
if(! (o instanceof CTTbl)){
return null;
}

View File

@ -66,6 +66,7 @@ public class XWPFFooter extends XWPFHeaderFooter {
bodyElements.add(t);
}
}
cursor.dispose();
getAllPictures();
}
@ -125,6 +126,7 @@ public class XWPFFooter extends XWPFHeaderFooter {
bodyElements.add(t);
}
}
cursor.dispose();
getAllPictures();
} catch (IOException e) {
// TODO Auto-generated catch block

View File

@ -67,6 +67,7 @@ public class XWPFHeader extends XWPFHeaderFooter {
tables.add(t);
}
}
cursor.dispose();
getAllPictures();
}
@ -131,6 +132,7 @@ public class XWPFHeader extends XWPFHeaderFooter {
bodyElements.add(t);
}
}
cursor.dispose();
getAllPictures();
} catch (IOException e) {
// TODO Auto-generated catch block

View File

@ -504,6 +504,7 @@ public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBo
bodyElements.add(t);
}
}
cursor.dispose();
getAllPictures();
}
@ -521,6 +522,7 @@ public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBo
CTRow row = (CTRow)o;
cursor.toParent();
o = cursor.getObject();
cursor.dispose();
if(! (o instanceof CTTbl)){
return null;
}

View File

@ -107,6 +107,8 @@ public class XWPFParagraph implements IBodyElement{
}
}
}
c.dispose();
// Look for bits associated with the runs
for(XWPFRun run : runs) {
@ -1159,6 +1161,8 @@ public class XWPFParagraph implements IBodyElement{
else
candCharPos=0;
}
c.dispose();
}
return null;
}

View File

@ -628,6 +628,8 @@ public class XWPFRun {
}
}
}
c.dispose();
// Any picture text?
if(pictureText != null && pictureText.length() > 0) {

View File

@ -65,6 +65,7 @@ public class XWPFTableCell implements IBody {
bodyElements.add(t);
}
}
cursor.dispose();
}
@ -336,6 +337,7 @@ public class XWPFTableCell implements IBody {
CTRow row = (CTRow)o;
cursor.toParent();
o = cursor.getObject();
cursor.dispose();
if(! (o instanceof CTTbl)){
return null;
}