Fixed that an uninitialized skin stays in memory when fatal error occurred.

This commit is contained in:
spx 2011-09-10 22:04:51 +00:00
parent 83675c7f30
commit a52abc05af

View File

@ -2229,15 +2229,8 @@ void CRainmeter::ActivateConfig(int configIndex, int iniIndex)
m_ConfigStrings[configIndex].active = iniIndex + 1; m_ConfigStrings[configIndex].active = iniIndex + 1;
WriteActive(skinConfig, iniIndex); WriteActive(skinConfig, iniIndex);
try
{
CreateMeterWindow(skinPath, skinConfig, skinIniFile); CreateMeterWindow(skinPath, skinConfig, skinIniFile);
} }
catch (CError& error)
{
LogError(error);
}
}
} }
bool CRainmeter::DeactivateConfig(CMeterWindow* meterWindow, int configIndex, bool save) bool CRainmeter::DeactivateConfig(CMeterWindow* meterWindow, int configIndex, bool save)
@ -2287,11 +2280,21 @@ void CRainmeter::CreateMeterWindow(const std::wstring& path, const std::wstring&
if (mw) if (mw)
{ {
m_Meters[config] = mw; m_Meters[config] = mw;
try
{
mw->Initialize(*this); mw->Initialize(*this);
CDialogAbout::UpdateSkins(); CDialogAbout::UpdateSkins();
CDialogManage::UpdateSkins(mw); CDialogManage::UpdateSkins(mw);
} }
catch (CError& error)
{
DeleteMeterWindow(mw, false);
LogError(error);
}
}
} }
void CRainmeter::ClearDeleteLaterList() void CRainmeter::ClearDeleteLaterList()