Make C Interface exceptions thread local.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
5fda89bc72
commit
1000893652
|
@ -1,4 +1,3 @@
|
||||||
#include "Core.hpp"
|
#include "Core.hpp"
|
||||||
|
|
||||||
std::string ExceptionHandler::_lastException = "";
|
|
||||||
export const char* Arbutils_C_GetLastException() { return ExceptionHandler::GetLastException(); }
|
export const char* Arbutils_C_GetLastException() { return ExceptionHandler::GetLastException(); }
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
#define ArbutilsException 3;
|
#define ArbutilsException 3;
|
||||||
|
|
||||||
class ExceptionHandler {
|
class ExceptionHandler {
|
||||||
static std::string _lastException;
|
static thread_local std::string _ArbutilsLastException;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void SetLastException(const std::exception& e) { _lastException = std::string(e.what()); }
|
static void SetLastException(const std::exception& e) { _ArbutilsLastException = std::string(e.what()); }
|
||||||
static const char* GetLastException() { return _lastException.c_str(); }
|
static const char* GetLastException() { return _ArbutilsLastException.c_str(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define Try(data) \
|
#define Try(data) \
|
||||||
|
|
Loading…
Reference in New Issue