mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:17:43 +02:00
commit
59a5fac2f1
2 changed files with 5 additions and 5 deletions
|
@ -27,9 +27,9 @@ Resource::Size Resource::Sysmem::allocateMemory(Byte** dataAllocated, Size size)
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
// Try allocating as much as the required size + one block of memory
|
// Try allocating as much as the required size + one block of memory
|
||||||
newSize = size;
|
newSize = size;
|
||||||
(*dataAllocated) = new Byte[newSize];
|
try {
|
||||||
// Failed?
|
(*dataAllocated) = new Byte[newSize];
|
||||||
if (!(*dataAllocated)) {
|
} catch (const std::bad_alloc&) {
|
||||||
qWarning() << "Buffer::Sysmem::allocate() : Can't allocate a system memory buffer of " << newSize << "bytes. Fails to create the buffer Sysmem.";
|
qWarning() << "Buffer::Sysmem::allocate() : Can't allocate a system memory buffer of " << newSize << "bytes. Fails to create the buffer Sysmem.";
|
||||||
return NOT_ALLOCATED;
|
return NOT_ALLOCATED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1024,7 +1024,7 @@ int Octree::encodeTreeBitstream(OctreeElement* element,
|
||||||
roomForOctalCode = packetData->startSubTree(newCode);
|
roomForOctalCode = packetData->startSubTree(newCode);
|
||||||
|
|
||||||
if (newCode) {
|
if (newCode) {
|
||||||
delete newCode;
|
delete[] newCode;
|
||||||
codeLength = numberOfThreeBitSectionsInCode(newCode);
|
codeLength = numberOfThreeBitSectionsInCode(newCode);
|
||||||
} else {
|
} else {
|
||||||
codeLength = 1;
|
codeLength = 1;
|
||||||
|
@ -2064,7 +2064,7 @@ bool Octree::readJSONFromStream(unsigned long streamLength, QDataStream& inputSt
|
||||||
QVariant asVariant = asDocument.toVariant();
|
QVariant asVariant = asDocument.toVariant();
|
||||||
QVariantMap asMap = asVariant.toMap();
|
QVariantMap asMap = asVariant.toMap();
|
||||||
readFromMap(asMap);
|
readFromMap(asMap);
|
||||||
delete rawData;
|
delete[] rawData;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue