Properly free output file hash map

This commit is contained in:
Snaipe 2015-10-28 20:45:55 +01:00
parent 770c312f70
commit 446dc0f380
2 changed files with 9 additions and 0 deletions

View file

@ -361,6 +361,8 @@ void criterion_finalize(struct criterion_test_set *set) {
#ifndef ENABLE_VALGRIND_ERRORS
VALGRIND_ENABLE_ERROR_REPORTING;
#endif
criterion_free_output();
}
static void run_tests_async(struct criterion_test_set *set,

View file

@ -44,6 +44,13 @@ int criterion_add_output(const char *provider, const char *path) {
}
void criterion_free_output(void) {
for (khint_t k = kh_begin(outputs); k != kh_end(outputs); ++k) {
if (!kh_exist(outputs, k))
continue;
str_vec *vec = kh_value(outputs, k);
kv_destroy(*vec);
free(vec);
}
kh_destroy(ht_str, reporters);
kh_destroy(ht_path, outputs);
}