When removing a SXSSF sheet, ensure temp files associated with it are disposed of #57666

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1676833 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2015-04-29 19:28:26 +00:00
parent 15550d5d8c
commit d00da9fe03
1 changed files with 8 additions and 1 deletions

View File

@ -709,9 +709,16 @@ public class SXSSFWorkbook implements Workbook
@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();
}
/**