[*] account for null non-nullptrs in Shared class of apis

This commit is contained in:
Reece Wilson 2022-06-24 22:31:22 +01:00
parent cb3b1a582b
commit c3e01d31f8

View File

@ -60,6 +60,7 @@
{ \
void operator()(type *t) \
{ \
if (!t) return; \
name ## Release(t); \
} \
}; \
@ -75,7 +76,9 @@
template <class ... T> \
name ## Shared_t name ## Shared(T... args) \
{ \
return name ## Shared_t(name ## New(args...), name ## Release); \
auto ptr = name ## New(args...); \
if (!ptr) return {}; \
return name ## Shared_t(ptr, name ## Release); \
}
#endif