diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-04-24 13:24:41 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-04-24 13:24:41 +0200 |
commit | fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6 (patch) | |
tree | 06b2206059672a98ce7797e3e7359f5801e2f0b7 /src/main.c | |
parent | separated css and html, removed php-cli dependency (diff) | |
download | sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.gz sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.bz2 sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.lz sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.xz sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.tar.zst sear.c-fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6.zip |
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -86,7 +86,7 @@ void sc_signalhander (int s) { int main (int argc, char ** argv) { int rs = 0; struct sc_cache * c = sc_cache_init(); - struct MHD_Daemon * d; + struct MHD_Daemon * d = NULL; if (!c) { rs = 1; goto rc; @@ -103,8 +103,9 @@ int main (int argc, char ** argv) { fprintf(stderr, "cleaning up!\n"); fflush(stderr); rc: + if (d) + MHD_stop_daemon(d); /* stop the daemon and then free, threads might still be run */ xmlCleanupParser(); - MHD_stop_daemon(d); /* stop the daemon first and the free, threads might still be running */ sc_cache_free(c); return rs; } |