mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed crash when the config is switched to the variant.
This commit is contained in:
parent
78db448471
commit
fdae154245
@ -2228,7 +2228,7 @@ void CRainmeter::ActivateConfig(int configIndex, int iniIndex)
|
||||
else
|
||||
{
|
||||
// Deactivate the existing config
|
||||
DeactivateConfig((*iter).second, configIndex);
|
||||
DeactivateConfig((*iter).second, configIndex, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2262,7 +2262,7 @@ void CRainmeter::ActivateConfig(int configIndex, int iniIndex)
|
||||
}
|
||||
}
|
||||
|
||||
bool CRainmeter::DeactivateConfig(CMeterWindow* meterWindow, int configIndex)
|
||||
bool CRainmeter::DeactivateConfig(CMeterWindow* meterWindow, int configIndex, bool bLater)
|
||||
{
|
||||
if (configIndex >= 0 && configIndex < (int)m_ConfigStrings.size())
|
||||
{
|
||||
@ -2287,7 +2287,7 @@ bool CRainmeter::DeactivateConfig(CMeterWindow* meterWindow, int configIndex)
|
||||
// Disable the config in the ini-file
|
||||
WriteActive(meterWindow->GetSkinName(), -1);
|
||||
|
||||
return DeleteMeterWindow(meterWindow, true);
|
||||
return DeleteMeterWindow(meterWindow, bLater);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ public:
|
||||
const std::vector<std::wstring>& GetAllThemes() { return m_Themes; }
|
||||
|
||||
void ActivateConfig(int configIndex, int iniIndex);
|
||||
bool DeactivateConfig(CMeterWindow* meterWindow, int configIndex);
|
||||
bool DeactivateConfig(CMeterWindow* meterWindow, int configIndex, bool bLater = true);
|
||||
|
||||
const std::wstring& GetPath() { return m_Path; }
|
||||
const std::wstring& GetIniFile() { return m_IniFile; }
|
||||
|
@ -511,14 +511,6 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
||||
}
|
||||
else
|
||||
{
|
||||
if (configs[i].active != 0)
|
||||
{
|
||||
CMeterWindow* meterWindow = Rainmeter->GetMeterWindow(configs[i].config);
|
||||
if (meterWindow)
|
||||
{
|
||||
Rainmeter->DeactivateConfig(meterWindow, i);
|
||||
}
|
||||
}
|
||||
Rainmeter->ActivateConfig(i, j);
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user