mirror of
https://github.com/tnodir/fort
synced 2024-11-15 01:25:52 +00:00
UI: MemPlumber::getCaller: Check for isStarted()
This commit is contained in:
parent
994bc43ee6
commit
4c6ea29491
7
src/3rdparty/memplumber/memplumber.cpp
vendored
7
src/3rdparty/memplumber/memplumber.cpp
vendored
@ -98,12 +98,14 @@ class MemPlumberInternal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isVerbose() {
|
bool isVerbose() const {
|
||||||
return m_Verbose && m_Dumper != NULL;
|
return m_Verbose && m_Dumper != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
bool isStarted() const { return m_Started; }
|
||||||
|
|
||||||
static MemPlumberInternal& getInstance() {
|
static MemPlumberInternal& getInstance() {
|
||||||
static MemPlumberInternal instance;
|
static MemPlumberInternal instance;
|
||||||
return 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
|
// 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() {
|
const char* getCaller() {
|
||||||
|
|
||||||
|
if (!MemPlumberInternal::getInstance().isStarted())
|
||||||
|
return "";
|
||||||
|
|
||||||
#ifdef USE_CPPTRACE
|
#ifdef USE_CPPTRACE
|
||||||
const auto objTrace = cpptrace::generate_object_trace(/*skip=*/3, /*max_depth=*/1);
|
const auto objTrace = cpptrace::generate_object_trace(/*skip=*/3, /*max_depth=*/1);
|
||||||
const auto trace = objTrace.resolve();
|
const auto trace = objTrace.resolve();
|
||||||
|
Loading…
Reference in New Issue
Block a user