[*] account for null non-nullptrs in Shared class of apis
This commit is contained in:
parent
cb3b1a582b
commit
c3e01d31f8
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user