diff options
author | Marcus Comstedt | 2005-10-13 18:50:53 +0000 |
---|---|---|
committer | Marcus Comstedt | 2005-10-13 18:50:53 +0000 |
commit | 57e1c6451dc928f4162de019486e3af259d39423 (patch) | |
tree | ccf84f9e49be23c03cac986490c05f6b94c0b555 /scumm/saveload.cpp | |
parent | 66fbe2d3c42355d714fd1cd638323f367de4c329 (diff) | |
download | scummvm-rg350-57e1c6451dc928f4162de019486e3af259d39423.tar.gz scummvm-rg350-57e1c6451dc928f4162de019486e3af259d39423.tar.bz2 scummvm-rg350-57e1c6451dc928f4162de019486e3af259d39423.zip |
Improved savefile error handling:
* New flush() method in WriteStream class to flush pending I/O, in order
to detect any I/O errors
* Use of flush() and ioFailed() added to scumm engine save function
* Dreamcast backend extended to support the new checks
svn-id: r19066
Diffstat (limited to 'scumm/saveload.cpp')
-rw-r--r-- | scumm/saveload.cpp | 6 |
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; |