From 85fdf5c8ead2e273923cc158e575130621a271c5 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Thu, 9 Feb 2017 17:14:50 +0900 Subject: [PATCH] Fix SVACE issue - memory leak - Delete the elements of mResourceRequests Change-Id: Ib0e95cccf8ac755b2e5571a0efd2b90e15a64747 --- .../test-platform-abstraction.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp index 991ae0743..63def8d42 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp @@ -40,6 +40,7 @@ TestPlatformAbstraction::TestPlatformAbstraction() TestPlatformAbstraction::~TestPlatformAbstraction() { + DiscardRequest(); } void TestPlatformAbstraction::Suspend() @@ -266,6 +267,7 @@ void TestPlatformAbstraction::SetAllResourceRequestsAsLoaded() Integration::ResourcePointer resource(bitmap); bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80); SetResourceLoaded( request->GetId(), request->GetType()->id, resource ); + delete request; } mResourceRequests.Clear(); } @@ -275,13 +277,21 @@ void TestPlatformAbstraction::SetAllResourceRequestsAsFailed( Integration::Resou for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End(); iter != endIter; ++iter ) { + Integration::ResourceRequest* request = *iter; SetResourceLoadFailed( (*iter)->GetId(), failure); + delete request; } mResourceRequests.Clear(); } void TestPlatformAbstraction::DiscardRequest() { + for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End(); + iter != endIter; ++iter ) + { + Integration::ResourceRequest* request = *iter; + delete request; + } mResourceRequests.Clear(); } -- 2.34.1