diff --git a/src/lib/base/XBase.cpp b/src/lib/base/XBase.cpp index 123fb297..1c776bcd 100644 --- a/src/lib/base/XBase.cpp +++ b/src/lib/base/XBase.cpp @@ -48,7 +48,8 @@ XBase::what() const _NOEXCEPT { const char* what = std::runtime_error::what(); if (strlen(what) == 0) { - return getWhat().c_str(); + m_what = getWhat(); + return m_what.c_str(); } return what; } diff --git a/src/lib/base/XBase.h b/src/lib/base/XBase.h index 5e576aec..b3688436 100644 --- a/src/lib/base/XBase.h +++ b/src/lib/base/XBase.h @@ -48,6 +48,8 @@ protected: */ virtual CString format(const char* id, const char* defaultFormat, ...) const throw(); +private: + mutable CString m_what; }; /*!