free only last detached element of slist

This commit is contained in:
Felix Ruess
2009-08-31 16:59:28 +00:00
parent b8b0d30029
commit f266a8a88f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ void UpdateSensorLatency(double time, gpointer cur_reading, GSList **history, do
*history = g_slist_remove_link(*history, last);
g_free(((struct BoozDatedSensor*)last->data)->value);
g_free((struct BoozDatedSensor*)last->data);
g_slist_free(last);
g_slist_free_1(last);
last = g_slist_last(*history);
}
/* update sensor */
+1 -1
View File
@@ -10,7 +10,7 @@ struct BoozDatedSensor {
};
/* cur_reading and sensor_reading must be of a type that can be cast to DoubleVect3* */
extern void UpdateSensorLatency(double time, gpointer cur_reading, GSList **history,
extern void UpdateSensorLatency(double time, gpointer cur_reading, GSList **history,
double latency, gpointer sensor_reading);
#endif /* NPS_SENSORS_UTILS_H */