Fix memory leak 50/190950/1
authorhyunho <hhstark.kang@samsung.com>
Wed, 10 Oct 2018 00:49:24 +0000 (09:49 +0900)
committerhyunho <hhstark.kang@samsung.com>
Wed, 10 Oct 2018 00:49:24 +0000 (09:49 +0900)
Change-Id: I6e071fb9af5c3fd045a135c17dcbcf0758ee5f2a
Signed-off-by: hyunho <hhstark.kang@samsung.com>
unittest/src/test-complication.cc
unittest/src/test-design-element.cc
unittest/src/test-editables-manager.cc
unittest/src/test-received-editable.cc

index e92bde1..a393ecc 100644 (file)
@@ -220,6 +220,7 @@ TEST_F(WC, SetContext)
   bundle_add_str(b, "TEST_KEY", "TEST_VALUE");
 
   Bundle* bundle = new Bundle(b);
+  bundle_free(b);
   WC::complication->SetContext(std::unique_ptr<Bundle>(bundle));
   std::unique_ptr<Bundle>& ctx = WC::complication->GetContext();
 
@@ -234,6 +235,7 @@ TEST_F(WC, GetLastContext)
   bundle_add_str(b, "TEST_KEY", "TEST_VALUE");
 
   Bundle* bundle = new Bundle(b);
+  bundle_free(b);
   WC::complication->SetContext(std::unique_ptr<Bundle>(bundle));
   WC::complication->UpdateLastContext();
   std::unique_ptr<Bundle>& ctx = WC::complication->GetLastContext();
index eb6fda1..c058939 100644 (file)
@@ -138,6 +138,7 @@ TEST_F(DE, SetContext)
   bundle_add_str(b, "TEST_KEY", "TEST_VALUE");
 
   Bundle* bundle = new Bundle(b);
+  bundle_free(b);
   DE::element->SetContext(std::unique_ptr<Bundle>(bundle));
   std::unique_ptr<Bundle>& ctx = DE::element->GetContext();
 
@@ -152,6 +153,7 @@ TEST_F(DE, GetLastContext)
   bundle_add_str(b, "TEST_KEY", "TEST_VALUE");
 
   Bundle* bundle = new Bundle(b);
+  bundle_free(b);
   DE::element->SetContext(std::unique_ptr<Bundle>(bundle));
   DE::element->UpdateLastContext();
   std::unique_ptr<Bundle>& ctx = DE::element->GetLastContext();
index 81df0ea..3feccdf 100644 (file)
@@ -46,6 +46,7 @@ TEST_F(EDITABLES_MANAGER, StoreContext)
   bundle_add_str(b, "TEST_KEY", "TEST_VALUE");
 
   Bundle bundle(b);
+  bundle_free(b);
   EditablesManager::GetInst(true).StoreContext(10, "org.tizen.mock_provider/test",
         bundle);
   int ret = EditablesManager::GetInst(true).DeleteContext(
index 4eb23d0..75f7c57 100644 (file)
@@ -143,6 +143,7 @@ TEST_F(RE, SetContext)
   bundle_add_str(b, "TEST_KEY", "TEST_VALUE");
 
   Bundle* bundle = new Bundle(b);
+  bundle_free(b);
   RE::received->SetContext(std::unique_ptr<Bundle>(bundle));
   std::unique_ptr<Bundle>& ctx = RE::received->GetContext();
   RE::received->UpdateLastContext();