mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed crash when AverageSize= is set in Measure.
This commit is contained in:
parent
6c36a662e5
commit
606afe79e6
@ -447,14 +447,16 @@ bool CMeasure::PostUpdate()
|
|||||||
{
|
{
|
||||||
if (m_AverageSize > 0)
|
if (m_AverageSize > 0)
|
||||||
{
|
{
|
||||||
if (!m_AverageValues.empty())
|
size_t averageValuesSize = m_AverageValues.size();
|
||||||
|
|
||||||
|
if (m_AverageSize != averageValuesSize)
|
||||||
{
|
{
|
||||||
m_AverageValues.resize(m_AverageSize, m_Value);
|
m_AverageValues.resize(m_AverageSize, m_Value);
|
||||||
|
averageValuesSize = m_AverageValues.size();
|
||||||
|
m_AveragePos %= averageValuesSize;
|
||||||
}
|
}
|
||||||
m_AverageValues[m_AveragePos] = m_Value;
|
m_AverageValues[m_AveragePos] = m_Value;
|
||||||
|
|
||||||
size_t averageValuesSize = m_AverageValues.size();
|
|
||||||
|
|
||||||
++m_AveragePos;
|
++m_AveragePos;
|
||||||
m_AveragePos %= averageValuesSize;
|
m_AveragePos %= averageValuesSize;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user