aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'scumm')
-rw-r--r--scumm/saveload.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index 5252402ec8..3b426358c7 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -109,6 +109,12 @@ bool ScummEngine::saveState(int slot, bool compat) {
Serializer ser(0, out, CURRENT_VER);
saveOrLoad(&ser, CURRENT_VER);
+ out->flush();
+ if(out->ioFailed()) {
+ delete out;
+ debug(1, "State save as '%s' FAILED", filename);
+ return false;
+ }
delete out;
debug(1, "State saved as '%s'", filename);
return true;