Don't allow update intervals slower than 1 second.

This commit is contained in:
Peter Johnson
2015-09-06 11:41:35 -07:00
parent 123ba9c670
commit e1efb7364e

View File

@@ -124,9 +124,11 @@ void DispatcherBase::Stop() {
}
void DispatcherBase::SetUpdateRate(double interval) {
// don't allow update rates faster than 100 ms
// don't allow update rates faster than 100 ms or slower than 1 second
if (interval < 0.1)
interval = 0.1;
else if (interval > 1.0)
interval = 1.0;
m_update_rate = static_cast<unsigned int>(interval * 1000);
}