mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
33 lines
647 B
C++
33 lines
647 B
C++
#include "platform_initializer.h"
|
|
|
|
#include "core/error_macros.h"
|
|
|
|
#if PLATFORM_LINUX
|
|
#include "linux/crash_handler_linux.h"
|
|
#endif
|
|
|
|
void PlatformInitializer::allocate_crash_handler() {
|
|
ERR_FAIL_COND(_crash_handler);
|
|
|
|
#if PLATFORM_LINUX
|
|
_crash_handler = new CrashHandlerLinux();
|
|
_crash_handler->enable();
|
|
#endif
|
|
}
|
|
|
|
void PlatformInitializer::free_crash_handler() {
|
|
if (_crash_handler) {
|
|
delete _crash_handler;
|
|
_crash_handler = nullptr;
|
|
}
|
|
}
|
|
|
|
void PlatformInitializer::allocate_all() {
|
|
allocate_crash_handler();
|
|
}
|
|
|
|
void PlatformInitializer::free_all() {
|
|
free_crash_handler();
|
|
}
|
|
|
|
CrashHandler *PlatformInitializer::_crash_handler = nullptr; |