From: Michael Stapelberg Date: Mon, 28 Aug 2017 07:23:42 +0000 (+0200) Subject: do leak check before exiting X-Git-Tag: 4.14~3^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F2888%2Fhead;p=i3%2Fi3 do leak check before exiting related to #2541 --- diff --git a/src/main.c b/src/main.c index 43efb3c2..21265446 100644 --- a/src/main.c +++ b/src/main.c @@ -21,6 +21,10 @@ #include #include "shmlog.h" +#ifdef I3_ASAN_ENABLED +#include +#endif + #include "sd-daemon.h" /* The original value of RLIMIT_CORE when i3 was started. We need to restore @@ -551,6 +555,9 @@ int main(int argc, char *argv[]) { xcb_generic_error_t *error = xcb_request_check(conn, cookie); if (error != NULL) { ELOG("Another window manager seems to be running (X error %d)\n", error->error_code); +#ifdef I3_ASAN_ENABLED + __lsan_do_leak_check(); +#endif return 1; }