diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-05-16 19:55:31 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-05-16 19:55:31 +0200 |
commit | 1f5f40c091a3e91626fc39ba31d7407cbae9aa4d (patch) | |
tree | 8a642b1aaecb3284975e0205db84fb88e590c96f /CommandLine.c | |
parent | 204bc710baf145212b26a413de3c082ed9d99142 (diff) |
Print current settings on crash
Diffstat (limited to 'CommandLine.c')
-rw-r--r-- | CommandLine.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CommandLine.c b/CommandLine.c index 16ded1fa..60582dcf 100644 --- a/CommandLine.c +++ b/CommandLine.c @@ -361,7 +361,7 @@ int CommandLine_run(const char* name, int argc, char** argv) { CRT_done(); if (settings->changed) { - int r = Settings_write(settings); + int r = Settings_write(settings, false); if (r < 0) fprintf(stderr, "Can not save configuration to %s: %s\n", settings->filename, strerror(-r)); } @@ -373,10 +373,12 @@ int CommandLine_run(const char* name, int argc, char** argv) { MetersPanel_cleanup(); UsersTable_delete(ut); - Settings_delete(settings); if (flags.pidMatchList) Hashtable_delete(flags.pidMatchList); + /* Delete Settings last, since it can get accessed in the crash handler */ + Settings_delete(settings); + return 0; } |