From 5804667dbb4798c7c20c3ef51e4e1767148f1c7c Mon Sep 17 00:00:00 2001 From: Jared Mulconry Date: Sun, 1 Oct 2017 17:51:13 +1100 Subject: [PATCH] Addressed some mismatched news/deletes caused by the new glTF2 sources. --- code/glTF2Asset.h | 2 +- code/glTF2Asset.inl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/glTF2Asset.h b/code/glTF2Asset.h index e2b61c646..63282dc6e 100644 --- a/code/glTF2Asset.h +++ b/code/glTF2Asset.h @@ -511,7 +511,7 @@ namespace glTF2 /// \fn ~SEncodedRegion() /// Destructor. - ~SEncodedRegion() { delete [] DecodedData; } + ~SEncodedRegion() { delete[] DecodedData; } }; /******************* Variables *******************/ diff --git a/code/glTF2Asset.inl b/code/glTF2Asset.inl index ac0f353dc..3082ebfab 100644 --- a/code/glTF2Asset.inl +++ b/code/glTF2Asset.inl @@ -313,7 +313,7 @@ inline void Buffer::Read(Value& obj, Asset& r) if (dataURI.base64) { uint8_t* data = 0; this->byteLength = Util::DecodeBase64(dataURI.data, dataURI.dataLength, data); - this->mData.reset(data); + this->mData.reset(data, std::default_delete()); if (statedLength > 0 && this->byteLength != statedLength) { throw DeadlyImportError("GLTF: buffer \"" + id + "\", expected " + to_string(statedLength) + @@ -326,7 +326,7 @@ inline void Buffer::Read(Value& obj, Asset& r) " bytes, but found " + to_string(dataURI.dataLength)); } - this->mData.reset(new uint8_t[dataURI.dataLength]); + this->mData.reset(new uint8_t[dataURI.dataLength], std::default_delete()); memcpy( this->mData.get(), dataURI.data, dataURI.dataLength ); } } @@ -432,7 +432,7 @@ uint8_t* new_data; // Copy data which place after replacing part. memcpy(&new_data[pBufferData_Offset + pReplace_Count], &mData.get()[pBufferData_Offset + pBufferData_Count], pBufferData_Offset); // Apply new data - mData.reset(new_data); + mData.reset(new_data, std::default_delete()); byteLength = new_data_size; return true;