mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 06:41:51 +00:00
TONY: Fix memory leak on save game failure (CID 1003579)
Though shouldn't it also alert the user to the failure?
This commit is contained in:
parent
9d28a6f531
commit
1cc0e9cb88
@ -530,7 +530,10 @@ void RMGfxEngine::disableMouse() {
|
||||
#define TONY_SAVEGAME_VERSION 8
|
||||
|
||||
void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Common::String &name) {
|
||||
Common::OutSaveFile *f;
|
||||
Common::OutSaveFile *f = g_system->getSavefileManager()->openForSaving(fn);
|
||||
if (f == NULL)
|
||||
return;
|
||||
|
||||
byte *state;
|
||||
char buf[4];
|
||||
RMPoint tp = _tony.position();
|
||||
@ -549,10 +552,6 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
|
||||
buf[2] = 'S';
|
||||
buf[3] = TONY_SAVEGAME_VERSION;
|
||||
|
||||
f = g_system->getSavefileManager()->openForSaving(fn);
|
||||
if (f == NULL)
|
||||
return;
|
||||
|
||||
f->write(buf, 4);
|
||||
f->writeUint32LE(thumbsize);
|
||||
f->write(curThumb, thumbsize);
|
||||
|
Loading…
x
Reference in New Issue
Block a user