qt: Destroy the widgets when changing joystick device.

Just removing them from layout will not destroy them.
This commit is contained in:
ts-korhonen
2022-03-15 18:24:38 +02:00
parent 83000338aa
commit 3c3e42fb84

View File

@@ -82,7 +82,9 @@ int JoystickConfiguration::selectedPov(int pov) {
void JoystickConfiguration::on_comboBoxDevice_currentIndexChanged(int index) {
for (auto w : widgets) {
ui->ct->removeWidget(w);
w->deleteLater();
}
widgets.clear();
if (index == 0) {
return;