summaryrefslogtreecommitdiff
path: root/src/io/ozlibstream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/ozlibstream.cpp')
-rw-r--r--src/io/ozlibstream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/io/ozlibstream.cpp b/src/io/ozlibstream.cpp
index b936219787..5f479f83f8 100644
--- a/src/io/ozlibstream.cpp
+++ b/src/io/ozlibstream.cpp
@@ -95,6 +95,7 @@ int deflate_streambuf::sync()
void ozlibstream::close()
{
+ std::ios_base::iostate old_ex = exceptions();
try
{
buf.close();
@@ -105,7 +106,6 @@ void ozlibstream::close()
// `setstate` to throw an `ios_base::failure` which would replace
// the original exception. Temporarily disable exceptions on this
// stream, set the `badbit`, then restore the exception mask.
- std::ios_base::iostate old_ex = exceptions();
try {
exceptions(std::ios_base::goodbit);
setstate(std::ios_base::badbit);