@cryptotaxi247 / netdata-1 / commits / e474a6290

save memory before cleaning up the childs to prevent crashing before saving the database

Costa Tsaousis (ktsaou) committed Feb 6, 2016 at 07:43 UTC e474a6290e079a4d910a5c1e0e7bff65c2bcad53
1 file changed +2 -1
src/main.c
+2 -1
@@ -40,8 +40,9 @@ int netdata_exit = 0;
40
41 void netdata_cleanup_and_exit(int ret)
42 {
43 - kill_childs();
43 + netdata_exit = 1;
44 rrdset_free_all();
45 + kill_childs();
46 unlink("/var/run/netdata.pid");
47 info("NetData exiting. Bye bye...");
48 exit(ret);