summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-02-06 07:43:01 +0200
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-02-06 07:43:01 +0200
commite474a6290e079a4d910a5c1e0e7bff65c2bcad53 (patch)
treeaf42109c7b5d41624c08cc7a349fc657d911cfe5 /src
parent56ee3a77006efdc1fb78ea041986b1f7a6ba42b9 (diff)
save memory before cleaning up the childs to prevent crashing before saving the database
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 6ac3009fb8..38d84db0f0 100755
--- a/src/main.c
+++ b/src/main.c
@@ -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);