Fix SVACE issue 03/113903/1
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 9 Feb 2017 08:22:56 +0000 (17:22 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 9 Feb 2017 08:22:56 +0000 (17:22 +0900)
1. memory leak - Delete the elements of mResourceRequests
2. Uninitialized class members

Change-Id: I72ffa76a6ced393fb92d1bc32a18007f12f71710

adaptors/ecore/wayland/display-connection-impl-ecore-wl.cpp
adaptors/tizen/framework-tizen.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp

index eb262c576f71d0eb41f6f6a5c2e0ad37352a18a5..64d93899dc5026a303686c95d42b76925322b223 100644 (file)
@@ -42,6 +42,8 @@ DisplayConnection* DisplayConnection::New()
 }
 
 DisplayConnection::DisplayConnection()
+: mDisplay( NULL ),
+  mSurfaceType( RenderSurface::ECORE_RENDER_SURFACE )
 {
 }
 
index 8aba914a5fe9b2b6f14355d7ce65cbef1d91d01c..baeff235747995e5f446f17725884f9575ef133c 100644 (file)
@@ -68,7 +68,8 @@ struct Framework::Impl
 // Constructor
   Impl(void* data, Type type )
   : mAbortCallBack( NULL ),
-    mCallbackManager( NULL )
+    mCallbackManager( NULL ),
+    mEventCallback()
   {
     mFramework = static_cast<Framework*>(data);
 
index db22b8638bbaa96b72bf8c8ba808e12914affc51..61f88f02c5839d4508d5523c070e2ed6ba361e08 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();
 }