diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index 3d2e6e6b7..78e3623d9 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -823,6 +823,26 @@ std::string CLI::output_filepath(const Model &model, IO::ExportFormat format) co return proposed_path.string(); } +// __has_feature() is used later for Clang, this is for compatibility with other compilers (such as GCC and MSVC) +#ifndef __has_feature +# define __has_feature(x) 0 +#endif + +#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) +extern "C" { + // Based on https://github.com/google/skia/blob/main/tools/LsanSuppressions.cpp + const char *__lsan_default_suppressions() { + return "leak:libfontconfig\n" // FontConfig looks like it leaks, but it doesn't. + "leak:libfreetype\n" // Unsure, appeared upgrading Debian 9->10. + "leak:libGLX_nvidia.so\n" // For NVidia driver. + "leak:libnvidia-glcore.so\n" // For NVidia driver. + "leak:libnvidia-tls.so\n" // For NVidia driver. + "leak:terminator_CreateDevice\n" // For Intel Vulkan drivers. + ; + } +} +#endif + #if defined(_MSC_VER) || defined(__MINGW32__) extern "C" { __declspec(dllexport) int __stdcall slic3r_main(int argc, wchar_t **argv)