From f3407ef80477d722efe2849f37e98b533608ee42 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 25 May 2017 22:35:27 +0200 Subject: [PATCH] aiMetaData: introduce aiMetaData::Dealloc. --- include/assimp/metadata.h | 9 ++++++++- test/unit/utMetadata.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index e57525092..ded08d14b 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -134,7 +134,6 @@ struct aiMetadata { // empty } - /** * @brief The destructor. */ @@ -199,6 +198,14 @@ struct aiMetadata { return data; } + /** + * @brief Deallocates property fields + keys. + */ + static inline + void Dealloc( aiMetadata *metadata ) { + delete metadata; + } + template inline void Add(const std::string& key, const T& value) { diff --git a/test/unit/utMetadata.cpp b/test/unit/utMetadata.cpp index fc9216266..b44de1eb2 100644 --- a/test/unit/utMetadata.cpp +++ b/test/unit/utMetadata.cpp @@ -55,7 +55,7 @@ protected: } virtual void TearDown() { - delete m_data; + aiMetadata::Dealloc( m_data ); } };