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 ); } };