Print current settings on crash

This commit is contained in:
Christian Göttsche
2021-05-16 19:55:31 +02:00
parent 204bc710ba
commit 1f5f40c091
4 changed files with 30 additions and 10 deletions

View File

@ -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;
}