diff --git a/CInterface/Core.cpp b/CInterface/Core.cpp index beca1ae..b12294d 100644 --- a/CInterface/Core.cpp +++ b/CInterface/Core.cpp @@ -1,4 +1,4 @@ #include "Core.hpp" -std::string ExceptionHandler::_lastException = ""; +char* ExceptionHandler::_lastException = 0; export const char* CreatureLib_C_GetLastException() { return ExceptionHandler::GetLastException(); } diff --git a/CInterface/Core.hpp b/CInterface/Core.hpp index 6616b28..fb903cd 100644 --- a/CInterface/Core.hpp +++ b/CInterface/Core.hpp @@ -9,11 +9,11 @@ #define CreatureLibException 1; class ExceptionHandler { - static std::string _lastException; + static char* _lastException; 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) { _lastException = strcpy(_lastException, e.what()); } + static const char* GetLastException() { return _lastException; } }; #define Try(data) \