Fix SVACE issue - memory leak 05/113905/1
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 9 Feb 2017 08:27:41 +0000 (17:27 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 9 Feb 2017 08:27:41 +0000 (17:27 +0900)
- Delete the elements of mResourceRequests

Change-Id: Ic4ba5a09e6c3dbfc8ebfc85a0344790f6a16a661

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp

index db22b86..61f88f0 100644 (file)
@@ -40,6 +40,7 @@ TestPlatformAbstraction::TestPlatformAbstraction()
 
 TestPlatformAbstraction::~TestPlatformAbstraction()
 {
+  DiscardRequest();
 }
 
 void TestPlatformAbstraction::Suspend()
@@ -264,6 +265,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();
 }
@@ -273,13 +275,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();
 }