mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-11-16 11:04:28 +01:00
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:
1 parent
92dbee7e79
commit
112800cb98
4 files changed
+29
-8
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user