don't free vector in destroy, more asserts
This commit is contained in:
parent
5251aa9e82
commit
ea2b8900dd
@ -40,8 +40,6 @@ void vec_destroy(Vector *vec) {
|
||||
vec->destroy(vec->elements[i]);
|
||||
}
|
||||
}
|
||||
free(vec);
|
||||
vec = NULL;
|
||||
}
|
||||
|
||||
int vec_insert(Vector *vec, void *data, size_t index) {
|
||||
|
@ -37,6 +37,7 @@ void test_ll() {
|
||||
|
||||
printf("List: ");
|
||||
print_ll(list);
|
||||
assert(*(int*)data == 2);
|
||||
printf("Removed: %d\n", *((int *) data));
|
||||
|
||||
ll_destroy(list);
|
||||
@ -236,6 +237,7 @@ void test_vector() {
|
||||
assert(t == NULL);
|
||||
|
||||
vec_destroy(v);
|
||||
free(v);
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user