--- a/application/davcontroller.c Thu Nov 14 23:22:35 2024 +0100 +++ b/application/davcontroller.c Fri Nov 15 21:50:20 2024 +0100 @@ -935,7 +935,7 @@ free(sz_total); free(label1.ptr); - + return 1; } @@ -998,6 +998,16 @@ return 0; } +static int qthr_download_finished(void *data) { + return 0; +} + +static void uithr_download_finished(UiEvent *event, void *data) { + DavFileDownload *download = data; + printf("download finished\n"); + ui_object_unref(download->dialog); +} + typedef struct DlStackElm { DavResource *resource; @@ -1083,6 +1093,8 @@ ui_threadpool_job(download->queue, download->ui, qthr_download_resource, file, NULL, NULL); } } + + ui_threadpool_job(download->queue, download->ui, qthr_download_finished, download, uithr_download_finished, download); cxListDestroy(stack); @@ -1145,6 +1157,8 @@ ui_set(download->progress, 0); ui_show(dialog); + + ui_object_ref(dialog); // start upload and stat threads ui_job(ui, jobthr_download_scan, download, uithr_download_scan_finished, download);