From 58d572d52f3c57fb19d12777250a52ced956310e Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Fri, 15 Mar 2024 08:41:47 +0000 Subject: [PATCH] [*] Catch most stls control-block allocation failure --- Include/auROXTL/AU_MACROS.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Include/auROXTL/AU_MACROS.hpp b/Include/auROXTL/AU_MACROS.hpp index a8b06c9..06b0a9a 100644 --- a/Include/auROXTL/AU_MACROS.hpp +++ b/Include/auROXTL/AU_MACROS.hpp @@ -77,8 +77,18 @@ name ## Shared_t name ## Shared(T &&... args) \ { \ auto ptr = name ## New(AuForward(args)...); \ - if (!ptr) return {}; \ - return name ## Shared_t(ptr, name ## Release); \ + if (!ptr) \ + { \ + return {}; \ + } \ + AUROXTL_COMMODITY_TRY \ + { \ + return name ## Shared_t(ptr, name ## Release); \ + } \ + AUROXTL_COMMODITY_CATCH \ + { \ + return {}; \ + } \ } #endif