ASAN: trigger leak before exiting
This disables the default leak-check-on-exit behavior which reports a bunch of leaks that are only leaks while exiting, at which point they don’t matter, because the operating system will clean up the memory our process used.
This commit is contained in:
@ -12,6 +12,10 @@
|
||||
#include <float.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef I3_ASAN_ENABLED
|
||||
#include <sanitizer/lsan_interface.h>
|
||||
#endif
|
||||
|
||||
#include "all.h"
|
||||
#include "shmlog.h"
|
||||
|
||||
@ -1658,6 +1662,9 @@ void cmd_layout_toggle(I3_CMD, const char *toggle_mode) {
|
||||
*/
|
||||
void cmd_exit(I3_CMD) {
|
||||
LOG("Exiting due to user command.\n");
|
||||
#ifdef I3_ASAN_ENABLED
|
||||
__lsan_do_leak_check();
|
||||
#endif
|
||||
ipc_shutdown();
|
||||
unlink(config.ipc_socket_path);
|
||||
xcb_disconnect(conn);
|
||||
|
Reference in New Issue
Block a user