X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=control.c;h=3a827aee65d39f40345ae3fcec9c9a923dd22d79;hb=ac3a0ef9cea990f4fbb6e9a912576d0db4ee8ca9;hp=90bfde943098f5c97c0b926a5d8e8aabb36a6eec;hpb=4c189692e67bc68d520d7adf462348ea4fd54900;p=android-x86%2Fhardware-intel-libsensors.git diff --git a/control.c b/control.c index 90bfde9..3a827ae 100644 --- a/control.c +++ b/control.c @@ -558,6 +558,13 @@ int sensor_activate(int s, int enabled) close(dev_fd); device_fd[dev_num] = -1; } + + /* If we recorded a trail of samples for filtering, delete it */ + if (sensor_info[s].history) { + free(sensor_info[s].history); + sensor_info[s].history = NULL; + sensor_info[s].history_size = 0; + } return 0; }