fixed error: could not convert from ‘void’ to ‘bool’
This commit is contained in:
parent
5255fd3a77
commit
403dbc7791
@ -35,7 +35,9 @@ namespace util {
|
||||
std::shared_ptr<T> create(Args&&... args) {
|
||||
std::lock_guard lock(mutex);
|
||||
if (freeObjects.empty()) {
|
||||
if (!allocateNew()) {
|
||||
try {
|
||||
allocateNew();
|
||||
} catch (const std::bad_alloc&) {
|
||||
return std::make_shared<T>(std::forward<Args>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user