From 3bec8d8d00b61495af10ad53d6226baba1237dca Mon Sep 17 00:00:00 2001 From: gocha Date: Tue, 15 Dec 2009 01:39:35 +0000 Subject: [PATCH] hopefully fix awful movie handle leaks --- desmume/src/movie.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desmume/src/movie.cpp b/desmume/src/movie.cpp index 86abdd7f0..ed95e56a5 100644 --- a/desmume/src/movie.cpp +++ b/desmume/src/movie.cpp @@ -458,6 +458,7 @@ const char* _CDECL_ FCEUI_LoadMovie(const char *fname, bool _read_only, bool tas opened = true; // } // fs.close(); + delete fp; // } if(!opened) { @@ -465,6 +466,7 @@ const char* _CDECL_ FCEUI_LoadMovie(const char *fname, bool _read_only, bool tas // fstream fs (fname, std::ios_base::in); loadedfm2 = LoadFM2(currMovieData, fp, INT_MAX, false); // fs.close(); + delete fp; } if(!loadedfm2) @@ -1093,7 +1095,7 @@ void FCEUI_MakeBackupMovie(bool dispMessage) MovieData md = currMovieData; //Get current movie data EMUFILE* outf = new EMUFILE_FILE(backupFn.c_str(),"wb"); //FCEUD_UTF8_fstream(backupFn, "wb"); //open/create file md.dump(outf,false); //dump movie data -// delete outf; //clean up, delete file object + delete outf; //clean up, delete file object //TODO, decide if fstream successfully opened the file and print error message if it doesn't