mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed a issue that Rainmeter crashes at LSLog(). (multithreading issue)
This commit is contained in:
@ -1213,6 +1213,8 @@ CRainmeter::CRainmeter()
|
||||
|
||||
m_TrayWindow = NULL;
|
||||
|
||||
InitializeCriticalSection(&m_CsLogData);
|
||||
|
||||
INITCOMMONCONTROLSEX initCtrls;
|
||||
initCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
||||
initCtrls.dwICC = ICC_TAB_CLASSES;
|
||||
@ -1254,6 +1256,8 @@ CRainmeter::~CRainmeter()
|
||||
UpdateDesktopWorkArea(true);
|
||||
}
|
||||
|
||||
DeleteCriticalSection(&m_CsLogData);
|
||||
|
||||
GdiplusShutdown(m_GDIplusToken);
|
||||
}
|
||||
|
||||
@ -3731,6 +3735,19 @@ void CRainmeter::DeleteLogFile()
|
||||
}
|
||||
}
|
||||
|
||||
void CRainmeter::AddAboutLogInfo(const LOG_INFO& logInfo)
|
||||
{
|
||||
EnterCriticalSection(&m_CsLogData);
|
||||
|
||||
m_LogData.push_front(logInfo);
|
||||
if (m_LogData.size() > MAXABOUTLOGLINES)
|
||||
{
|
||||
m_LogData.pop_back();
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&m_CsLogData);
|
||||
}
|
||||
|
||||
void CRainmeter::SetLogging(bool logging)
|
||||
{
|
||||
m_Logging = logging;
|
||||
|
Reference in New Issue
Block a user