[Video] Make sure to close trace

This commit is contained in:
zilmar 2018-11-24 13:17:37 +10:30
parent f76769622c
commit 58305edc8b
4 changed files with 14 additions and 2 deletions

View File

@ -675,6 +675,7 @@ void CALL CloseDLL(void)
voodoo.gamma_table_g = 0;
delete[] voodoo.gamma_table_b;
voodoo.gamma_table_b = 0;
StopTrace();
}
/******************************************************************

View File

@ -270,7 +270,7 @@ void FullScreenResolutions::init()
int current = 0;
char smode[256];
memset(&enumMode, 0, sizeof(DEVMODE));
memset(&prevInfo, 0, sizeof(ResolutionInfo));
prevInfo = ResolutionInfo();
while (EnumDisplaySettings(NULL, iModeNum++, &enumMode) != 0)
{
ResolutionInfo curInfo(NULL, enumMode.dmPelsWidth, enumMode.dmPelsHeight, enumMode.dmDisplayFrequency);

View File

@ -96,4 +96,14 @@ void StartTrace(void)
}
g_LogFile = new CTraceFileLog(LogFilePath, g_settings->FlushLogs(), CLog::Log_New, 500);
TraceAddModule(g_LogFile);
}
}
void StopTrace(void)
{
if (g_LogFile)
{
TraceRemoveModule(g_LogFile);
delete g_LogFile;
g_LogFile = NULL;
}
}

View File

@ -30,3 +30,4 @@ enum TraceModuleGlide64
void SetupTrace(void);
void StartTrace(void);
void StopTrace(void);