mirror of https://github.com/apache/poi.git
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:
parent
15550d5d8c
commit
d00da9fe03
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue