diff options
Diffstat (limited to 'src/process_url.c')
-rw-r--r-- | src/process_url.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/process_url.c b/src/process_url.c index e51da98..1bb411a 100644 --- a/src/process_url.c +++ b/src/process_url.c @@ -506,11 +506,13 @@ void poll_status(status_t *stat) { } merge_and_cleanup(curl_conf); append_log("Download %s finished.\n", curl_conf->outfn); + free_and_nullify(curl_conf); // Perform the callback if (is_empty_queue(&dl_queue) && callback_g) { - callback_g(p_callback_struct_g); + thrd_t cb_thrd; + thrd_create(&cb_thrd, callback_g, p_callback_struct_g); + thrd_detach(cb_thrd); } - free_and_nullify(curl_conf); } mtx_unlock(&mtx); } |