diff --git a/AdaptiveBrightness/main_window.cpp b/AdaptiveBrightness/main_window.cpp index ce88ee8..5ca4e6a 100644 --- a/AdaptiveBrightness/main_window.cpp +++ b/AdaptiveBrightness/main_window.cpp @@ -19,7 +19,7 @@ #include "sensor_driver.hpp" #include "utils.hpp" -MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) +MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), m_mtx(QMutex::RecursionMode::Recursive) { qDebug(ltr("Creating main window")); @@ -54,6 +54,8 @@ void MainWindow::closeEvent(QCloseEvent* event) void MainWindow::enumSensors() { + m_sensors.clear(); + auto sensors = enumerateSensors(); for(auto& sensor: sensors) {