[MeterLine] Fixed crash when LineCount not equal to MeasureNameN

http://rainmeter.net/forum/viewtopic.php?f=14&t=14388
This commit is contained in:
spx 2012-12-22 04:32:28 +09:00
parent bdc079a7a8
commit 6a44aae5fc

View File

@ -215,14 +215,11 @@ bool CMeterLine::Update()
if (maxSize > 0)
{
int allValuesSize = (int)m_AllValues.size();
int counter = 0;
std::vector<CMeasure*>::const_iterator i = m_Measures.begin();
for ( ; i != m_Measures.end(); ++i)
for (auto i = m_Measures.cbegin(); counter < allValuesSize && i != m_Measures.cend(); ++i, ++counter)
{
double value = (*i)->GetValue();
m_AllValues[counter][m_CurrentPos] = value;
++counter;
m_AllValues[counter][m_CurrentPos] = (*i)->GetValue();
}
++m_CurrentPos;