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