diff --git a/include/bx/debug.h b/include/bx/debug.h index 45e18c6..f5bc37d 100644 --- a/include/bx/debug.h +++ b/include/bx/debug.h @@ -76,6 +76,9 @@ namespace bx /// void debugOutputCallstack(uint32_t _skip); + /// Install BX exception handler. + void installExceptionHandler(); + } // namespace bx #endif // BX_DEBUG_H_HEADER_GUARD diff --git a/src/debug.cpp b/src/debug.cpp index c1f21e9..b1b3b78 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -552,6 +552,16 @@ namespace bx #endif // BX_CONFIG_EXCEPTION_HANDLING_* - ExceptionHandler s_exceptionHandler; + void installExceptionHandler() + { + static bool s_installed = false; + + if (!s_installed) + { + s_installed = true; + + static ExceptionHandler s_exceptionHandler; + } + } } // namespace bx