mainwindow: Correctly remove cards when they go away
The reference is owned by the VBox, so we remove it there and it gets cleaned up, like other widgets. Fixes: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/issues/162 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/merge_requests/98>
This commit is contained in:
parent
a9d7a65d82
commit
c70cdeed74
|
@ -1272,7 +1272,7 @@ void MainWindow::removeCard(uint32_t index) {
|
|||
if (!cardWidgets.count(index))
|
||||
return;
|
||||
|
||||
delete cardWidgets[index];
|
||||
cardsVBox->remove(*cardWidgets[index]);
|
||||
cardWidgets.erase(index);
|
||||
updateDeviceVisibility();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue