Signed-off-by: Mika Laitio <lamikr@pilppa.org>
Device *device;
SensorDevice *sensor;
long read_int_sec;
+ plp::Data *data;
read_int_sec = DeviceConfig::get_read_interval_seconds();
if (read_int_sec < 0)
device = (Device *)*list_iter;
sensor = dynamic_cast<SensorDevice *>(device);
if (sensor != NULL) {
- sensor->get_data();
+ data = sensor->get_data();
+ if (data != NULL)
+ delete(data);
}
}
sleep(read_int_sec);
if (data != NULL) {
log_debug("returning data: %s\n", data->to_string().c_str());
((BusMessage *)ret_val)->add_string_parameter(key.str(), data->to_string());
+ delete(data);
}
}
indx++;