mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fix crash when actions are executed by plugin threads after skin unload
This commit is contained in:
@@ -1172,7 +1172,10 @@ LRESULT CALLBACK CRainmeter::MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
|
||||
break;
|
||||
|
||||
case WM_RAINMETER_EXECUTE:
|
||||
Rainmeter->ExecuteCommand((const WCHAR*)lParam, (CMeterWindow*)wParam);
|
||||
if (Rainmeter->HasMeterWindow((CMeterWindow*)wParam))
|
||||
{
|
||||
Rainmeter->ExecuteCommand((const WCHAR*)lParam, (CMeterWindow*)wParam);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1598,6 +1601,19 @@ void CRainmeter::RemoveUnmanagedMeterWindow(CMeterWindow* meterWindow)
|
||||
}
|
||||
}
|
||||
|
||||
bool CRainmeter::HasMeterWindow(const CMeterWindow* meterWindow) const
|
||||
{
|
||||
for (auto it = m_MeterWindows.begin(); it != m_MeterWindows.end(); ++it)
|
||||
{
|
||||
if ((*it).second == meterWindow)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
CMeterWindow* CRainmeter::GetMeterWindow(const std::wstring& folderPath)
|
||||
{
|
||||
const WCHAR* folderSz = folderPath.c_str();
|
||||
|
Reference in New Issue
Block a user