]> source.dussan.org Git - poi.git/commitdiff
dispose xml cursor when iteration over it is done (more)
authorMaxim Valyanskiy <maxcom@apache.org>
Wed, 17 Nov 2010 08:13:40 +0000 (08:13 +0000)
committerMaxim Valyanskiy <maxcom@apache.org>
Wed, 17 Nov 2010 08:13:40 +0000 (08:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1035947 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingParagraph.java
src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFooter.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHeader.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java

index e2dcc6cf41b48763bc8f3c275762751935ebe853..f1e84ce6c1ae444cf0fb40b5ed5763ccc9fb8c4f 100644 (file)
@@ -44,6 +44,8 @@ public class DrawingParagraph {
                 text.append('\n');
             }
         }
+
+        c.dispose();
         
         return text;
     }
index a926d8b3fc9a48bc700b50d881c5cee9fffef010..3716f7e93dc27b7ef75fb401ed50b8bfea90a031 100644 (file)
@@ -69,6 +69,8 @@ public class XSLFCommonSlideData {
                     }
                 }
             }
+
+            c.dispose();
         }
 
         return out;
index 3d1ee2a58a0171e31a7420e0d2854c6ea86de4ed..4188cbdac1687480cc48bdd80e63109993c3abc5 100644 (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;
                }
index 73834d767216417814c294e2c42e92854f67e68d..feaf9f7dd00f37489e66600bc9f023451f754346 100644 (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
index d49aa5d7ecdbc7c1e5463380c3bd8b00c76988ae..07f59afffea3eafe24eee28d3095b821b021bf16 100644 (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
index 5aedc15f9b98cc2eef866d7598497314726ab9e9..96274be21acf0c61334b5f8bf789edcec91d4dd9 100644 (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;
                }
index 2e7e16f3eda4d47416ca335ac6bb4072dd0a53ec..2833695e923723d3bc312002505c568c17dbcd7e 100644 (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;
     }
index 067f2c0882094eec489b998a73cfb6a27154eb3a..0e8bbb20ad5d028b1226c3a7bfbc805510e6e100 100644 (file)
@@ -628,6 +628,8 @@ public class XWPFRun {
               }
            }
        }
+
+       c.dispose();
        
        // Any picture text?
        if(pictureText != null && pictureText.length() > 0) {
index 656bf307a8680f514bbd1c40db2d2945a5a49541..9ffb65a340e1cb003024a096674390b93550a939 100644 (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;
                }