From 1f5f40c091a3e91626fc39ba31d7407cbae9aa4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 16 May 2021 19:55:31 +0200 Subject: Print current settings on crash --- CommandLine.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'CommandLine.c') 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; } -- cgit v1.2.3