mirror of
https://github.com/aristocratos/btop.git
synced 2026-06-12 17:54:27 -04:00
no memory leak
This commit is contained in:
10
src/btop.cpp
10
src/btop.cpp
@@ -237,15 +237,15 @@ void clean_quit(int sig) {
|
||||
std::cerr << Global::fg_red << "ERROR: " << Global::fg_white << Global::exit_error_msg << Fx::reset << endl;
|
||||
}
|
||||
Logger::info("Quitting! Runtime: " + sec_to_dhms(time_s() - Global::start_time));
|
||||
|
||||
const auto excode = (sig != -1 ? sig : 0);
|
||||
|
||||
close(0);
|
||||
//? Assume error if still not cleaned up and call quick_exit to avoid a segfault from Tools::atomic_lock destructor
|
||||
#ifndef __APPLE__
|
||||
quick_exit(excode);
|
||||
if (Tools::active_locks > 0) {
|
||||
quick_exit((sig != -1 ? sig : 0));
|
||||
}
|
||||
#endif
|
||||
|
||||
exit(excode);
|
||||
if (sig != -1) exit(sig);
|
||||
}
|
||||
|
||||
//* Handler for SIGTSTP; stops threads, restores terminal and sends SIGSTOP
|
||||
|
||||
Reference in New Issue
Block a user