From d4fbaad4efe5d0ddf325da44ecbab105ebb2954e Mon Sep 17 00:00:00 2001 From: Peter Hillman Date: Thu, 23 Jan 2020 12:33:11 +1300 Subject: [PATCH] fix memory leak in test suite Signed-off-by: Peter Hillman --- OpenEXR/IlmImfTest/testMultiPartApi.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/OpenEXR/IlmImfTest/testMultiPartApi.cpp b/OpenEXR/IlmImfTest/testMultiPartApi.cpp index c6265b88ab..c0bfb68823 100644 --- a/OpenEXR/IlmImfTest/testMultiPartApi.cpp +++ b/OpenEXR/IlmImfTest/testMultiPartApi.cpp @@ -463,6 +463,21 @@ generateRandomFile (int partCount, const std::string & fn) } } + for (size_t i = 0 ; i < parts.size() ; ++i ) + { + int partType = partTypes[i]; + + if (partType == 0) + { + delete (OutputPart*) parts[i]; + } + else + { + delete (TiledOutputPart*) parts[i]; + } + + } + delete[] tiledHalfData; delete[] tiledUintData; delete[] tiledFloatData;