freeing arrays
This commit is contained in:
@@ -298,6 +298,11 @@ void float_array_init(float_array *array) {
|
||||
array->length = 0;
|
||||
}
|
||||
|
||||
void float_array_free(float_array *array) {
|
||||
free(array->items);
|
||||
float_array_init(array);
|
||||
}
|
||||
|
||||
double double_array_get(const double_array *array, int32_t index) {
|
||||
if (index >= 0 && index < array->length) {
|
||||
return array->items[index];
|
||||
|
||||
@@ -109,6 +109,7 @@ float float_array_get(const float_array *array, int32_t index);
|
||||
void float_array_set(float_array *array, const float value, int32_t index);
|
||||
void float_array_allocate(float_array *array, int32_t capacity);
|
||||
void float_array_init(float_array *array);
|
||||
void float_array_free(float_array *array);
|
||||
|
||||
typedef struct {
|
||||
double *items;
|
||||
|
||||
@@ -185,6 +185,10 @@ cleanup:
|
||||
free(NULL);
|
||||
free(session_data);
|
||||
free(lap_timestamps);
|
||||
float_array_free(&throttle_data_all);
|
||||
float_array_free(&brake_data_all);
|
||||
float_array_free(&steering_data_all);
|
||||
float_array_free(&speed_data_all);
|
||||
duckdb_disconnect(&conn);
|
||||
duckdb_close(&db);
|
||||
goto exit;
|
||||
|
||||
Reference in New Issue
Block a user