Fix undefined behavior due to recursive mutex locking, and properly clear sensors when re-enumerating
This commit is contained in:
parent
392a03a23d
commit
77d9a22419
@ -19,7 +19,7 @@
|
|||||||
#include "sensor_driver.hpp"
|
#include "sensor_driver.hpp"
|
||||||
#include "utils.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"));
|
qDebug(ltr("Creating main window"));
|
||||||
|
|
||||||
@ -54,6 +54,8 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
|||||||
|
|
||||||
void MainWindow::enumSensors()
|
void MainWindow::enumSensors()
|
||||||
{
|
{
|
||||||
|
m_sensors.clear();
|
||||||
|
|
||||||
auto sensors = enumerateSensors();
|
auto sensors = enumerateSensors();
|
||||||
|
|
||||||
for(auto& sensor: sensors) {
|
for(auto& sensor: sensors) {
|
||||||
|
Loading…
Reference in New Issue
Block a user