[Tizen] Fix Property::Value memory leak 97/266097/1 accepted/tizen/6.0/unified/20211108.075012 submit/tizen_6.0/20211106.031527
authorEunki Hong <eunkiki.hong@samsung.com>
Fri, 5 Nov 2021 18:27:42 +0000 (11:27 -0700)
committerEunki Hong <eunkiki.hong@samsung.com>
Fri, 5 Nov 2021 18:27:42 +0000 (11:27 -0700)
Change-Id: I2e0a0516d1785799623ed58bd7cab2ecba772ae5
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
dali/public-api/object/property-value.cpp

index 1af8e12..ea27171 100644 (file)
@@ -322,14 +322,28 @@ struct Property::Value::Impl
       }
       case Property::ARRAY:
       {
-        auto obj = other.GetArray();
-        ConstructInplace(mData.mArray.member, std::move(obj));
+        if(isSameType)
+        {
+          mData.mArray.member = other.GetArray();
+        }
+        else
+        {
+          auto obj = other.GetArray();
+          ConstructInplace(mData.mArray.member, std::move(obj));
+        }
         break;
       }
       case Property::MAP:
       {
-        auto obj = other.GetMap();
-        ConstructInplace(mData.mMap.member, std::move(obj));
+        if(isSameType)
+        {
+          mData.mMap.member = other.GetMap();
+        }
+        else
+        {
+          auto obj = other.GetMap();
+          ConstructInplace(mData.mMap.member, std::move(obj));
+        }
         break;
       }
       case Property::VECTOR4: