UI: Don't add removed sources when refreshing LoadAudioSources

This can be fired by a callback during source removal. The code was
re-adding the source that was just removed, causing the program to
freeze when trying to remove all sources.
This commit is contained in:
Richard Stanway 2020-03-02 22:23:13 +01:00
parent 2a4a46deed
commit 2f0134bf60

View File

@ -2262,7 +2262,8 @@ void OBSBasicSettings::LoadAudioSources()
obs_enum_sources(
[](void *data, obs_source_t *source) {
auto &AddSource = *static_cast<AddSource_t *>(data);
AddSource(source);
if (!obs_source_removed(source))
AddSource(source);
return true;
},
static_cast<void *>(&AddSource));