Make C Interface exceptions thread local.
continuous-integration/drone/push Build is passing

This commit is contained in:
Deukhoofd committed 2020-07-28 18:35:42 +02:00
1 parent 5fda89bc72
commit 1000893652
2 files changed
+3 -4

No files matched your search

-1
View File
@@ -1,4 +1,3 @@
#include "Core.hpp"
std::string ExceptionHandler::_lastException = "";
export const char* Arbutils_C_GetLastException() { return ExceptionHandler::GetLastException(); }
+3 -3
View File
@@ -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) \