mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-07-13 16:55:02 -04:00
UI: Use invokeMethod to refresh LoadAudioSources
Sources may be removed or destroyed by other threads which resulted in GUI calls outside of the main Qt thread.
This commit is contained in:
@@ -2247,10 +2247,12 @@ void OBSBasicSettings::LoadAudioSources()
|
||||
label->setMinimumSize(QSize(170, 0));
|
||||
label->setAlignment(Qt::AlignRight | Qt::AlignTrailing |
|
||||
Qt::AlignVCenter);
|
||||
connect(label, &OBSSourceLabel::Removed,
|
||||
[=]() { LoadAudioSources(); });
|
||||
connect(label, &OBSSourceLabel::Destroyed,
|
||||
[=]() { LoadAudioSources(); });
|
||||
connect(label, &OBSSourceLabel::Removed, [=]() {
|
||||
QMetaObject::invokeMethod(this, "ReloadAudioSources");
|
||||
});
|
||||
connect(label, &OBSSourceLabel::Destroyed, [=]() {
|
||||
QMetaObject::invokeMethod(this, "ReloadAudioSources");
|
||||
});
|
||||
|
||||
layout->addRow(label, form);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user