From b77ea63596874858265d8225597f8ed378fd2b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 22 Sep 2021 17:01:32 +0200 Subject: [PATCH] Trade: ensure the deprecated SceneData constructor uses default deleters. Otherwise the instances wouldn't be usable from AbstractImporter subclasses. --- src/Magnum/Trade/SceneData.cpp | 8 +++++--- src/Magnum/Trade/Test/SceneDataTest.cpp | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Trade/SceneData.cpp b/src/Magnum/Trade/SceneData.cpp index 13671755d6..6c334b2904 100644 --- a/src/Magnum/Trade/SceneData.cpp +++ b/src/Magnum/Trade/SceneData.cpp @@ -515,9 +515,11 @@ SceneData::SceneData(std::vector children2D, std::vector{1}; + _fields[0] = SceneFieldData{SceneField::Parent, objects, parents}; Utility::copy(children, objects); constexpr Int parent[]{-1}; Utility::copy(Containers::stridedArrayView(parent).broadcasted<0>(parents.size()), parents); diff --git a/src/Magnum/Trade/Test/SceneDataTest.cpp b/src/Magnum/Trade/Test/SceneDataTest.cpp index f9b29895fe..1cb12b0868 100644 --- a/src/Magnum/Trade/Test/SceneDataTest.cpp +++ b/src/Magnum/Trade/Test/SceneDataTest.cpp @@ -1444,6 +1444,11 @@ void SceneDataTest::constructDeprecated() { CORRADE_COMPARE_AS(scene.field(0), Containers::arrayView({-1, -1, -1, -1}), TestSuite::Compare::Container); + + /* The deleters have to be trivial, otherwise this instance wouldn't be + usable from an AbstractImporter */ + CORRADE_VERIFY(!scene.releaseFieldData().deleter()); + CORRADE_VERIFY(!scene.releaseData().deleter()); } #endif