mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:58:48 +08:00
free only last detached element of slist
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user