diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-06 17:00:33 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-06 17:00:33 +0100 |
| commit | d6ef32981a2402ec7b26c851ef13afd27a5582d8 (patch) | |
| tree | dd46cdb68a9160b81bc7d958a307a9f7bfa8da77 /src/search.cpp | |
| parent | 6a0f9d68555e0506a6aee42a5e25634196faf5a6 (diff) | |
free old results
Diffstat (limited to 'src/search.cpp')
| -rw-r--r-- | src/search.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/search.cpp b/src/search.cpp index fe039bd..3f1f496 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -353,6 +353,13 @@ finish_early:; return 0; } +void ts_destroy_result(ts_search_result* result) { + ts_memory_bucket_destroy(&result->memory); + ts_array_destroy(&result->files); + ts_array_destroy(&result->matches); + free(result); +} + static void *_ts_list_files_thread(void *args) { ts_search_result *info = (ts_search_result *)args; @@ -364,8 +371,7 @@ static void *_ts_list_files_thread(void *args) while (!info->prev_result->search_completed) { ts_thread_sleep(10); } - ts_memory_bucket_destroy(&info->prev_result->memory); - free(info->prev_result); + ts_destroy_result(info->prev_result); info->prev_result = nullptr; } |
