microsoft / DirectXMesh

DirectXMesh geometry processing library
https://walbourn.github.io/directxmesh/
MIT License
787 stars 151 forks source link

Mesh::Optimize unique_ptr for remap is not declared as array type #18

Closed davidkalloc closed 7 years ago

davidkalloc commented 7 years ago

Probably a typo. Other unique_ptr uses are correct.

std::unique_ptr<uint32_t> remap(new (std::nothrow) uint32_t[mnFaces]);

Should be:

std::unique_ptr<uint32_t[]> remap(new (std::nothrow) uint32_t[mnFaces]);

This mistake appears in two places, both for an array named remap.

https://github.com/Microsoft/DirectXMesh/blob/60028e807a602277f23a89a6334fd42bda473d5a/Meshconvert/Mesh.cpp#L609

https://github.com/Microsoft/DirectXMesh/blob/60028e807a602277f23a89a6334fd42bda473d5a/Meshconvert/Mesh.cpp#L642

walbourn commented 7 years ago

Thanks. Fixed!