From 5b4b16f36045247771a5288343f34b59219543e2 Mon Sep 17 00:00:00 2001 From: CwTCwT Date: Sat, 9 Jun 2018 21:25:59 +0200 Subject: [PATCH] use of malloc and free (given to shared ptr) for correct mem management --- code/BlenderCustomData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/BlenderCustomData.cpp b/code/BlenderCustomData.cpp index 7899f928f..82ab82874 100644 --- a/code/BlenderCustomData.cpp +++ b/code/BlenderCustomData.cpp @@ -57,7 +57,7 @@ namespace Assimp { */ #define IMPL_STRUCT_ALLOC(ty) \ uint8_t *alloc##ty(const size_t cnt) { \ - return new uint8_t[cnt * sizeof(ty)]; \ + return static_cast(malloc(cnt * sizeof(ty))); \ } /** @@ -172,7 +172,7 @@ namespace Assimp { const CustomDataTypeDescription cdtd = customDataTypeDescriptions[cdtype]; if (cdtd.Read && cdtd.Alloc) { // allocate cnt elements and parse them from file - out.reset(cdtd.Alloc(cnt)); + out.reset(cdtd.Alloc(cnt), free); return cdtd.Read(out.get(), cnt, db); } return false;