[*] Catch most stls control-block allocation failure
This commit is contained in:
parent
5ebb8b0fa8
commit
58d572d52f
@ -77,8 +77,18 @@
|
|||||||
name ## Shared_t name ## Shared(T &&... args) \
|
name ## Shared_t name ## Shared(T &&... args) \
|
||||||
{ \
|
{ \
|
||||||
auto ptr = name ## New(AuForward<T &&>(args)...); \
|
auto ptr = name ## New(AuForward<T &&>(args)...); \
|
||||||
if (!ptr) return {}; \
|
if (!ptr) \
|
||||||
return name ## Shared_t(ptr, name ## Release); \
|
{ \
|
||||||
|
return {}; \
|
||||||
|
} \
|
||||||
|
AUROXTL_COMMODITY_TRY \
|
||||||
|
{ \
|
||||||
|
return name ## Shared_t(ptr, name ## Release); \
|
||||||
|
} \
|
||||||
|
AUROXTL_COMMODITY_CATCH \
|
||||||
|
{ \
|
||||||
|
return {}; \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user