Also free ncurses terminal state when exiting under ASAN

This commit is contained in:
Mahmoud Al-Qudsi 2023-05-01 20:23:15 -05:00
parent 73983bada5
commit 91485c90ca

View file

@ -325,6 +325,13 @@ pub fn asan_maybe_exit(#[allow(unused)] code: i32) {
pub fn asan_before_exit() {
#[cfg(feature = "asan")]
if !is_forked_child() {
unsafe {
// Free ncurses terminal state
extern "C" {
fn env_cleanup();
}
env_cleanup();
}
}
}