common, GSnull, zzogl-pg, SPU2null: add more safety to some fclose functions. Avoid a bunch of double free and memory corruption.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3671 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut@gmail.com committed 2010-08-20 11:13:40 +00:00
1 parent 92dbee7e79
commit 112800cb98
4 files changed
+29 -8

No files matched your search

+8 -2
View File
@@ -136,7 +136,10 @@ EXPORT_C_(void) GSsetLogDir(const char* dir)
s_strLogPath = (dir==NULL) ? "logs/" : dir;
// Reload the log file after updated the path
if (gsLog != NULL) fclose(gsLog);
if (gsLog) {
fclose(gsLog);
gsLog = NULL;
}
OpenLog();
}
@@ -156,7 +159,10 @@ EXPORT_C_(void) GSshutdown()
GSCloseWindow();
#ifdef GS_LOG
if (gsLog) fclose(gsLog);
if (gsLog) {
fclose(gsLog);
gsLog = NULL;
}
#endif
}