diff --git a/qt/OpenRGBDialog2/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2/OpenRGBDialog2.cpp index 246e0832f..1440ea727 100644 --- a/qt/OpenRGBDialog2/OpenRGBDialog2.cpp +++ b/qt/OpenRGBDialog2/OpenRGBDialog2.cpp @@ -1341,6 +1341,20 @@ void OpenRGBDialog2::UpdateDevicesList() } } + /*-----------------------------------------------------*\ + | Remove all remaining device tabs | + \*-----------------------------------------------------*/ + tab_count = ui->FanTabBar->count(); + for(unsigned int tab_idx = 0; tab_idx < tab_count; tab_idx++) + { + unsigned int remove_idx = ui->FanTabBar->count() - 1; + QWidget* tab_widget = ui->FanTabBar->widget(remove_idx); + + ui->FanTabBar->removeTab(remove_idx); + + delete tab_widget; + } + /*-----------------------------------------------------*\ | Set up list of fan devices | \*-----------------------------------------------------*/