From 5017da5fe436f4713cb332a72b5115c02d8e7d3e Mon Sep 17 00:00:00 2001 From: Garux Date: Tue, 28 Sep 2021 05:55:17 +0300 Subject: [PATCH] use custom allocation errors handler --- tools/quake3/q3map2/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/quake3/q3map2/main.cpp b/tools/quake3/q3map2/main.cpp index b38ba50e..73d1fdfc 100644 --- a/tools/quake3/q3map2/main.cpp +++ b/tools/quake3/q3map2/main.cpp @@ -39,6 +39,10 @@ +static void new_handler(){ + Error( "Memory allocation failed, terminating" ); +} + /* ExitQ3Map() cleanup routine @@ -77,6 +81,9 @@ int main( int argc, char **argv ){ /* set exit call */ atexit( ExitQ3Map ); + /* set allocation error callback */ + std::set_new_handler( new_handler ); + Args args( argc, argv ); /* read general options first */