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:
@ -17,6 +17,9 @@
|
||||
#include <sys/un.h>
|
||||
#include <i3/ipc.h>
|
||||
#include <ev.h>
|
||||
#ifdef I3_ASAN_ENABLED
|
||||
#include <sanitizer/lsan_interface.h>
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
|
||||
@ -212,6 +215,9 @@ void got_data(struct ev_loop *loop, ev_io *watcher, int events) {
|
||||
/* EOF received. Since i3 will restart i3bar instances as appropriate,
|
||||
* we exit here. */
|
||||
DLOG("EOF received, exiting...\n");
|
||||
#ifdef I3_ASAN_ENABLED
|
||||
__lsan_do_leak_check();
|
||||
#endif
|
||||
clean_xcb();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
Reference in New Issue
Block a user