diff --git a/src/toxic.c b/src/toxic.c index ce53b7f..65bdf65 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -191,12 +191,14 @@ void exit_toxic_success(Tox *m) terminate_python(); #endif /* PYTHON */ - if (arg_opts.log_fp) { - fclose(arg_opts.log_fp); - } - free_global_data(); tox_kill(m); + + if (arg_opts.log_fp != NULL) { + fclose(arg_opts.log_fp); + arg_opts.log_fp = NULL; + } + endwin(); curl_global_cleanup(); @@ -1464,4 +1466,4 @@ int main(int argc, char **argv) } return 0; -} \ No newline at end of file +}