UI: Fix crash when hiding audio mixer item

This crash is suspected to be a QT bug that happens in 6.2.4, as
it only happens in this version. This is the QT version that is in
the Ubuntu 22.04 ppa, so this fix is a necessary evil as it affects
Ubuntu users.

This fixes the crash by deferring the hiding of the audio mixer
item to the next event loop.
master
cg2121 2022-08-11 05:12:48 -05:00 committed by Jim
parent 1fdaf121e6
commit be98abc088
1 changed files with 8 additions and 1 deletions

View File

@ -3294,7 +3294,14 @@ void OBSBasic::HideAudioControl()
if (!SourceMixerHidden(source)) {
SetSourceMixerHidden(source, true);
DeactivateAudioSource(source);
/* Due to a bug with QT 6.2.4, the version that's in the Ubuntu
* 22.04 ppa, hiding the audio mixer causes a crash, so defer to
* the next event loop to hide it. Doesn't seem to be a problem
* with newer versions of QT. */
QMetaObject::invokeMethod(this, "DeactivateAudioSource",
Qt::QueuedConnection,
Q_ARG(OBSSource, OBSSource(source)));
}
}