aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java')
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java
index 5333532c77..9e5e585c73 100644
--- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java
+++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java
@@ -1908,10 +1908,14 @@ public class SXSSFSheet implements Sheet
* @return true if the file was deleted, false if it wasn't.
*/
boolean dispose() throws IOException {
- if (!allFlushed) {
- flushRows();
+ boolean ret;
+ try {
+ if (!allFlushed) {
+ flushRows();
+ }
+ } finally {
+ ret = _writer == null || _writer.dispose();
}
- return _writer == null || _writer.dispose();
}
@Override