Commit b027861a 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 bd184872
...@@ -167,7 +167,11 @@ void AggregateSensor::addSensor(SensorProperty *sensor) ...@@ -167,7 +167,11 @@ void AggregateSensor::addSensor(SensorProperty *sensor)
void AggregateSensor::removeSensor(const QString &sensorPath) 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() void AggregateSensor::updateSensors()
......
Markdown is supported
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