diff --git a/src/Magnum/MeshTools/Copy.cpp b/src/Magnum/MeshTools/Copy.cpp index 88be5bec3..bd6e69428 100644 --- a/src/Magnum/MeshTools/Copy.cpp +++ b/src/Magnum/MeshTools/Copy.cpp @@ -138,7 +138,9 @@ Trade::MeshData copy(Trade::MeshData&& mesh) { /* Otherwise we have to allocate a new one and re-route the attributes to a potentially different vertex array */ } else { - attributeData = Containers::Array{originalAttributeData.size()}; + /* Using DefaultInit so the array has a default deleter and isn't + problematic to use in plugins */ + attributeData = Containers::Array{DefaultInit, originalAttributeData.size()}; for(std::size_t i = 0; i != originalAttributeData.size(); ++i) { attributeData[i] = Trade::MeshAttributeData{ originalAttributeData[i].name(), diff --git a/src/Magnum/MeshTools/Test/CopyTest.cpp b/src/Magnum/MeshTools/Test/CopyTest.cpp index 6518f8fab..349999e33 100644 --- a/src/Magnum/MeshTools/Test/CopyTest.cpp +++ b/src/Magnum/MeshTools/Test/CopyTest.cpp @@ -124,6 +124,14 @@ void CopyTest::copy() { CORRADE_COMPARE_AS(copy.indexData(), cube.indexData(), TestSuite::Compare::Container); CORRADE_COMPARE_AS(copy.vertexData(), cube.vertexData(), TestSuite::Compare::Container); + + /* The data should have a default deleter to make this usable in plugins */ + Containers::Array indexData = copy.releaseIndexData(); + Containers::Array vertexData = copy.releaseVertexData(); + Containers::Array attributeData = copy.releaseAttributeData(); + CORRADE_VERIFY(!indexData.deleter()); + CORRADE_VERIFY(!vertexData.deleter()); + CORRADE_VERIFY(!attributeData.deleter()); } void CopyTest::copyNoIndexData() {