movie file wasnt being closed correctly (perhaps fix the tas crashing bug)

This commit is contained in:
zeromus 2008-06-18 08:22:19 +00:00
parent 2958ab4e71
commit 0a05a707a0
2 changed files with 2 additions and 5 deletions

View File

@ -312,8 +312,8 @@ static void Export()
{
fstream* osRecordingMovie = FCEUD_UTF8_fstream(ofn.lpstrFile, "wb");
currMovieData.dump(osRecordingMovie);
osRecordingMovie->close();
delete osRecordingMovie;
osRecordingMovie = 0;
}
}

View File

@ -589,12 +589,10 @@ void FCEUI_LoadMovie(char *fname, bool _read_only, int _pauseframe)
static void closeRecordingMovie()
{
//if(fpRecordingMovie)
// fclose(fpRecordingMovie);
if(osRecordingMovie)
{
osRecordingMovie->close();
delete osRecordingMovie;
osRecordingMovie = 0;
}
}
@ -930,7 +928,6 @@ bool FCEUI_MovieGetInfo(const std::string& fname, MOVIE_INFO* info, bool skipFra
std::fstream* fp = FCEUD_UTF8_fstream(fname, "rb");
if(!fp) return false;
LoadFM2(md, fp, skipFrameCount);
fp->close();
delete fp;