From 12ef0a0200865a5070d065e5346aa1b8ddb9ed9b Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 11 Jun 2024 15:50:38 +0100 Subject: [PATCH] HarfBuzz: Enable atexit to silence some CRT debug memory leak warnings Before this change, after running a JUCE app on Windows under a debugger, and quitting it normally (e.g. pressing the close title button), the output log would display some memory leak diagnostics. This is because HarfBuzz expects to clean up statics using atexit, but atexit was not enabled. This change enables atexit on supported platforms, including Windows. --- modules/juce_graphics/juce_graphics_Harfbuzz.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/juce_graphics/juce_graphics_Harfbuzz.cpp b/modules/juce_graphics/juce_graphics_Harfbuzz.cpp index c882ccf07e..3601d545bb 100644 --- a/modules/juce_graphics/juce_graphics_Harfbuzz.cpp +++ b/modules/juce_graphics/juce_graphics_Harfbuzz.cpp @@ -53,6 +53,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations", "-Wexpansion-to-defined", "-Wunsafe-loop-optimizations") +#define HAVE_ATEXIT 1 + #if JUCE_LINUX || JUCE_BSD #ifndef JUCE_USE_FREETYPE #define JUCE_USE_FREETYPE 1