Commit 1e3fe8a6 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Also disconnect and unsubscribe from a sensor when removing it

Otherwise we still get updates for things that should have been removed.
parent 56982d8d
......@@ -167,7 +167,11 @@ void AggregateSensor::addSensor(SensorProperty *sensor)
void AggregateSensor::removeSensor(const QString &sensorPath)
{
m_sensors.remove(sensorPath);
auto sensor = m_sensors.take(sensorPath);
sensor->disconnect(this);
if (isSubscribed()) {
sensor->unsubscribe();
}
}
void AggregateSensor::updateSensors()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment