Release sources after name check
This commit is contained in:
parent
4b2170a725
commit
d3463e0772
2 changed files with 8 additions and 2 deletions
|
|
@ -174,8 +174,11 @@ OBSBasicSourceSelect::OBSBasicSourceSelect(OBSBasic *parent, const char *type_)
|
|||
|
||||
QString text{placeHolderText};
|
||||
int i = 1;
|
||||
while (obs_get_source_by_name(QT_TO_UTF8(text)))
|
||||
obs_source_t source = nullptr;
|
||||
while ((source = obs_get_source_by_name(QT_TO_UTF8(text)))) {
|
||||
obs_source_release(source);
|
||||
text = QString("%1 %2").arg(placeHolderText).arg(i++);
|
||||
}
|
||||
|
||||
ui->sourceName->setText(text);
|
||||
ui->sourceName->setFocus(); //Fixes deselect of text.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue