From f266a8a88f5b80df16793a100c12f921f36cfe24 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Mon, 31 Aug 2009 16:59:28 +0000 Subject: [PATCH] free only last detached element of slist --- sw/simulator/nps/nps_sensors_utils.c | 2 +- sw/simulator/nps/nps_sensors_utils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sw/simulator/nps/nps_sensors_utils.c b/sw/simulator/nps/nps_sensors_utils.c index 5544b29504..0ad6eeb4ce 100644 --- a/sw/simulator/nps/nps_sensors_utils.c +++ b/sw/simulator/nps/nps_sensors_utils.c @@ -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 */ diff --git a/sw/simulator/nps/nps_sensors_utils.h b/sw/simulator/nps/nps_sensors_utils.h index 6f77e6e580..655dff9828 100644 --- a/sw/simulator/nps/nps_sensors_utils.h +++ b/sw/simulator/nps/nps_sensors_utils.h @@ -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 */