fixed error: could not convert from ‘void’ to ‘bool’
Some checks failed
Build / Build (push) Failing after 9m39s
MSVC Build / build-windows (windows-latest) (push) Has been cancelled

This commit is contained in:
ShiftyX1 2025-12-08 19:58:00 +03:00
parent 5255fd3a77
commit 403dbc7791

View File

@ -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)...);
}
}