Fix delete / delete[] mismatches in glTF2 importer

pull/1432/head
Turo Lamminen 2017-09-14 10:34:16 +03:00
parent efd861253d
commit 1095ec454b
1 changed files with 2 additions and 2 deletions

View File

@ -357,7 +357,7 @@ inline bool Buffer::LoadFromStream(IOStream& stream, size_t length, size_t baseO
stream.Seek(baseOffset, aiOrigin_SET); stream.Seek(baseOffset, aiOrigin_SET);
} }
mData.reset(new uint8_t[byteLength]); mData.reset(new uint8_t[byteLength], std::default_delete<uint8_t[]>());
if (stream.Read(mData.get(), byteLength, 1) != 1) { if (stream.Read(mData.get(), byteLength, 1) != 1) {
return false; return false;
@ -451,7 +451,7 @@ inline void Buffer::Grow(size_t amount)
if (amount <= 0) return; if (amount <= 0) return;
uint8_t* b = new uint8_t[byteLength + amount]; uint8_t* b = new uint8_t[byteLength + amount];
if (mData) memcpy(b, mData.get(), byteLength); if (mData) memcpy(b, mData.get(), byteLength);
mData.reset(b); mData.reset(b, std::default_delete<uint8_t[]>());
byteLength += amount; byteLength += amount;
} }