mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-06 05:42:49 +02:00
Add check to stop processor before starting.
This commit is contained in:
parent
e12e746698
commit
9d15b00fbb
2 changed files with 5 additions and 1 deletions
|
@ -132,6 +132,10 @@ void MessagesMixer::processMaxMessagesContainer() {
|
|||
}
|
||||
|
||||
void MessagesMixer::startMaxMessagesProcessor() {
|
||||
if (_maxMessagesTimer) {
|
||||
stopMaxMessagesProcessor();
|
||||
}
|
||||
|
||||
_maxMessagesTimer = new QTimer();
|
||||
connect(_maxMessagesTimer, &QTimer::timeout, this, &MessagesMixer::processMaxMessagesContainer);
|
||||
_maxMessagesTimer->start(MESSAGES_MIXER_RATE_LIMITER_INTERVAL); // Clear the container every second.
|
||||
|
|
|
@ -46,7 +46,7 @@ private:
|
|||
const int DEFAULT_NODE_MESSAGES_PER_SECOND = 1000;
|
||||
int _maxMessagesPerSecond { 0 };
|
||||
|
||||
QTimer* _maxMessagesTimer;
|
||||
QTimer* _maxMessagesTimer { nullptr };
|
||||
};
|
||||
|
||||
#endif // hifi_MessagesMixer_h
|
||||
|
|
Loading…
Reference in a new issue