]> arthur.barton.de Git - netdata.git/commitdiff
save memory before cleaning up the childs to prevent crashing before saving the database
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 6 Feb 2016 05:43:01 +0000 (07:43 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 6 Feb 2016 05:43:01 +0000 (07:43 +0200)
src/main.c

index 6ac3009fb86d7ce0257dfbef38579b30727376a3..38d84db0f04b0af6e3c42da668d3e85e9f8700fd 100755 (executable)
@@ -40,8 +40,9 @@ int netdata_exit = 0;
 
 void netdata_cleanup_and_exit(int ret)
 {
-       kill_childs();
+       netdata_exit = 1;
        rrdset_free_all();
+       kill_childs();
        unlink("/var/run/netdata.pid");
        info("NetData exiting. Bye bye...");
        exit(ret);