fix(streamer-mode): access timer from correct thread (#5624)
This commit is contained in:
+1
-1
@@ -88,7 +88,7 @@
|
|||||||
- Dev: Fixed benchmarks segfaulting on run. (#5559)
|
- Dev: Fixed benchmarks segfaulting on run. (#5559)
|
||||||
- Dev: Refactored `MessageBuilder` to be a single class. (#5548)
|
- Dev: Refactored `MessageBuilder` to be a single class. (#5548)
|
||||||
- Dev: Recent changes are now shown in the nightly release description. (#5553, #5554, #5593)
|
- Dev: Recent changes are now shown in the nightly release description. (#5553, #5554, #5593)
|
||||||
- Dev: The timer for `StreamerMode` is now destroyed on the correct thread. (#5571)
|
- Dev: The timer for `StreamerMode` is now destroyed on the correct thread. (#5571, #5624)
|
||||||
- Dev: Cleanup some parts of the `magic_enum` adaptation for Qt. (#5587)
|
- Dev: Cleanup some parts of the `magic_enum` adaptation for Qt. (#5587)
|
||||||
- Dev: Refactored `static`s in headers to only be present once in the final app. (#5588)
|
- Dev: Refactored `static`s in headers to only be present once in the final app. (#5588)
|
||||||
- Dev: Run benchmarks in CI. (#5610)
|
- Dev: Run benchmarks in CI. (#5610)
|
||||||
|
|||||||
@@ -281,24 +281,27 @@ void StreamerModePrivate::settingChanged(StreamerModeSetting value)
|
|||||||
}
|
}
|
||||||
this->currentSetting_ = value;
|
this->currentSetting_ = value;
|
||||||
|
|
||||||
|
// in all cases: timer_ must be invoked from the correct thread
|
||||||
switch (this->currentSetting_)
|
switch (this->currentSetting_)
|
||||||
{
|
{
|
||||||
case StreamerModeSetting::Disabled: {
|
case StreamerModeSetting::Disabled: {
|
||||||
this->setEnabled(false);
|
this->setEnabled(false);
|
||||||
this->timer_->stop();
|
QMetaObject::invokeMethod(this->timer_, &QTimer::stop);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case StreamerModeSetting::Enabled: {
|
case StreamerModeSetting::Enabled: {
|
||||||
this->setEnabled(true);
|
this->setEnabled(true);
|
||||||
this->timer_->stop();
|
QMetaObject::invokeMethod(this->timer_, &QTimer::stop);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case StreamerModeSetting::DetectStreamingSoftware: {
|
case StreamerModeSetting::DetectStreamingSoftware: {
|
||||||
if (!this->timer_->isActive())
|
QMetaObject::invokeMethod(this->timer_, [this] {
|
||||||
{
|
if (!this->timer_->isActive())
|
||||||
this->timer_->start(20s);
|
{
|
||||||
this->check();
|
this->timer_->start(20s);
|
||||||
}
|
this->check();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user