diff --git a/Include/Aurora/Debug/ErrorStack.hpp b/Include/Aurora/Debug/ErrorStack.hpp index ff06bbfa..ddbdf47e 100644 --- a/Include/Aurora/Debug/ErrorStack.hpp +++ b/Include/Aurora/Debug/ErrorStack.hpp @@ -11,9 +11,6 @@ namespace Aurora::Debug { struct ErrorStack; - AUKN_SYM void PushStack(ErrorStack *pStack); - AUKN_SYM void PopStack(ErrorStack *pStack); - struct ErrorStackAccessor; struct ThreadMessage @@ -31,15 +28,8 @@ namespace Aurora::Debug struct ErrorStack { - inline ErrorStack() - { - PushStack(this); - } - - inline ~ErrorStack() - { - PopStack(this); - } + AUKN_SYM ErrorStack(); + AUKN_SYM ~ErrorStack(); inline bool HasCaptured() { diff --git a/Source/Debug/ErrorStack.cpp b/Source/Debug/ErrorStack.cpp index 09d6778c..18bbb2a3 100644 --- a/Source/Debug/ErrorStack.cpp +++ b/Source/Debug/ErrorStack.cpp @@ -56,8 +56,10 @@ namespace Aurora::Debug static thread_local ErrorStack *tlsErrorStackBase; - AUKN_SYM void PushStack(ErrorStack *pStack) + AUKN_SYM ErrorStack::ErrorStack() { + auto pStack = this; + if (!tlsErrorStackBase) { tlsErrorStackBase = pStack; @@ -74,8 +76,10 @@ namespace Aurora::Debug dumb.SetNext(itr, pStack); } - AUKN_SYM void PopStack(ErrorStack *pStack) + AUKN_SYM ErrorStack::~ErrorStack() { + auto pStack = this; + if (!tlsErrorStackBase) { return;