FIX: Direct crash when bad_alloc

Change-Id: If8e26218efa1750a7cbdced4f4b7db19d3a14db0
This commit is contained in:
maosheng.wei 2023-05-31 17:37:14 +08:00 committed by Lane.Wei
parent ec94c46665
commit f1a99020f6

View file

@ -3014,6 +3014,10 @@ extern "C" {
//AddVectoredExceptionHandler(1, CBaseException::UnhandledExceptionFilter);
SET_DEFULTER_HANDLER();
#endif
std::set_new_handler([]() {
int *a = nullptr;
*a = 0;
});
// Call the UTF8 main.
return CLI().run(argc, argv_ptrs.data());
}