You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2015/04/29 21:28:26 UTC

svn commit: r1676833 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java

Author: nick
Date: Wed Apr 29 19:28:26 2015
New Revision: 1676833

URL: http://svn.apache.org/r1676833
Log:
When removing a SXSSF sheet, ensure temp files associated with it are disposed of #57666

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java?rev=1676833&r1=1676832&r2=1676833&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java Wed Apr 29 19:28:26 2015
@@ -709,9 +709,16 @@ public class SXSSFWorkbook implements Wo
     @Override
     public void removeSheetAt(int index)
     {
-        XSSFSheet xSheet=_wb.getSheetAt(index);
+        // Get the sheet to be removed
+        XSSFSheet xSheet = _wb.getSheetAt(index);
+        SXSSFSheet sxSheet = getSXSSFSheet(xSheet);
+        
+        // De-register it
         _wb.removeSheetAt(index);
         deregisterSheetMapping(xSheet);
+        
+        // Clean up temporary resources
+        sxSheet.dispose();
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org