fix: explicitly check construct function error in thread_safe.h (#5184)
This commit is contained in:
@@ -438,7 +438,7 @@ namespace safe {
|
|||||||
|
|
||||||
if (!_count) {
|
if (!_count) {
|
||||||
new (_object_buf.data()) element_type;
|
new (_object_buf.data()) element_type;
|
||||||
if (_construct(*reinterpret_cast<element_type *>(_object_buf.data()))) {
|
if (_construct(*reinterpret_cast<element_type *>(_object_buf.data())) != 0) {
|
||||||
return ptr_t {nullptr};
|
return ptr_t {nullptr};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user