mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Prevent massive end-of-process leak sanitizer dump
This commit is contained in:
parent
28ec015ef4
commit
504bd40263
@ -85,7 +85,7 @@ add_gcc_compiler_cxxflags("-fno-exceptions -fno-rtti")
|
||||
add_gcc_compiler_cxxflags("-Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual")
|
||||
add_gcc_compiler_cflags("-Wchar-subscripts -Wwrite-strings")
|
||||
if(WITH_ASAN)
|
||||
add_gcc_compiler_flags("-fsanitize=address")
|
||||
add_gcc_compiler_flags("-fsanitize=address -DWITH_ASAN")
|
||||
endif()
|
||||
|
||||
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
|
||||
|
14
src/main.cpp
14
src/main.cpp
@ -28,6 +28,10 @@
|
||||
#include "gui/MainWindow.h"
|
||||
#include "gui/MessageBox.h"
|
||||
|
||||
#ifdef WITH_ASAN
|
||||
#include <sanitizer/lsan_interface.h>
|
||||
#endif
|
||||
|
||||
#ifdef QT_STATIC
|
||||
#include <QtPlugin>
|
||||
|
||||
@ -131,5 +135,13 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
int exitCode = app.exec();
|
||||
|
||||
#ifdef WITH_ASAN
|
||||
// do leak check here to prevent massive tail of end-of-process leak errors from third-party libraries
|
||||
__lsan_do_leak_check();
|
||||
__lsan_disable();
|
||||
#endif
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user