]> git.sur5r.net Git - i3/i3/commitdiff
do leak check before exiting 2888/head
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 28 Aug 2017 07:23:42 +0000 (09:23 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 28 Aug 2017 07:23:42 +0000 (09:23 +0200)
related to #2541

src/main.c

index 43efb3c2669f81a81d8b198a4eb398cc5122a1e1..212654466954649c47628b53ecb0dbc5cca5b524 100644 (file)
 #include <libgen.h>
 #include "shmlog.h"
 
+#ifdef I3_ASAN_ENABLED
+#include <sanitizer/lsan_interface.h>
+#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;
     }