From 4c6ea29491a3471ac459afa45dbf933775506189 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Wed, 17 Jul 2024 13:44:15 +0500 Subject: [PATCH] UI: MemPlumber::getCaller: Check for isStarted() --- src/3rdparty/memplumber/memplumber.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/memplumber/memplumber.cpp b/src/3rdparty/memplumber/memplumber.cpp index 1c1edcf4..eb17f4fc 100644 --- a/src/3rdparty/memplumber/memplumber.cpp +++ b/src/3rdparty/memplumber/memplumber.cpp @@ -98,12 +98,14 @@ class MemPlumberInternal { } } - bool isVerbose() { + bool isVerbose() const { return m_Verbose && m_Dumper != NULL; } public: + bool isStarted() const { return m_Started; } + static MemPlumberInternal& getInstance() { static MemPlumberInternal instance; return instance; @@ -360,6 +362,9 @@ class MemPlumberInternal { // We can use dbghelp but it's not supported on MinGW. Need to figure out a way to solve it on all platforms const char* getCaller() { + if (!MemPlumberInternal::getInstance().isStarted()) + return ""; + #ifdef USE_CPPTRACE const auto objTrace = cpptrace::generate_object_trace(/*skip=*/3, /*max_depth=*/1); const auto trace = objTrace.resolve();