diff --git a/CInterface/Core.cpp b/CInterface/Core.cpp index f38b4a6..f2682cf 100644 --- a/CInterface/Core.cpp +++ b/CInterface/Core.cpp @@ -1,4 +1,3 @@ #include "Core.hpp" -std::string ExceptionHandler::_lastException = ""; export const char* Arbutils_C_GetLastException() { return ExceptionHandler::GetLastException(); } diff --git a/CInterface/Core.hpp b/CInterface/Core.hpp index c01e58c..4e27496 100644 --- a/CInterface/Core.hpp +++ b/CInterface/Core.hpp @@ -9,11 +9,11 @@ #define ArbutilsException 3; class ExceptionHandler { - static std::string _lastException; + static thread_local std::string _ArbutilsLastException; public: - static void SetLastException(const std::exception& e) { _lastException = std::string(e.what()); } - static const char* GetLastException() { return _lastException.c_str(); } + static void SetLastException(const std::exception& e) { _ArbutilsLastException = std::string(e.what()); } + static const char* GetLastException() { return _ArbutilsLastException.c_str(); } }; #define Try(data) \