From 2b2e8552be2ba488e5ff5688ad4b17a90ad9fb6b Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Mon, 5 Oct 2020 21:48:24 -0400 Subject: [PATCH] Turn off the leak dumping under MSVC as wxWidgets causes it to falsely report dumps on exit --- common/single_top.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/single_top.cpp b/common/single_top.cpp index db2225311c..21db06c7a1 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -154,6 +154,12 @@ struct APP_SINGLE_TOP : public wxApp bool OnInit() override { +#if defined( _MSC_VER ) && defined( DEBUG ) + // wxWidgets turns on leak dumping in debug but its "flawed" and will falsely dump for half a hour + // _CRTDBG_ALLOC_MEM_DF is the usual default for MSVC + _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF ); +#endif + // Force wxHtmlWinParser initialization when a wxHtmlWindow is used only // in a shared modules (.so or .dll file) // Otherwise the Html text is displayed as plain text.