mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-08-19 17:10:31 +02:00
Replace try with nothrow
This commit is contained in:
parent
b2dd53ac43
commit
ae3d606e95
1 changed files with 3 additions and 3 deletions
|
@ -27,9 +27,9 @@ Resource::Size Resource::Sysmem::allocateMemory(Byte** dataAllocated, Size size)
|
|||
if (size > 0) {
|
||||
// Try allocating as much as the required size + one block of memory
|
||||
newSize = size;
|
||||
try {
|
||||
(*dataAllocated) = new Byte[newSize];
|
||||
} catch (const std::bad_alloc&) {
|
||||
(*dataAllocated) = new (std::nothrow) Byte[newSize];
|
||||
// Failed?
|
||||
if (!(*dataAllocated)) {
|
||||
qWarning() << "Buffer::Sysmem::allocate() : Can't allocate a system memory buffer of " << newSize << "bytes. Fails to create the buffer Sysmem.";
|
||||
return NOT_ALLOCATED;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue