lottieitem: free alloc memory properly. 60/193060/2
authorHermet Park <hermetpark@gmail.com>
Wed, 14 Nov 2018 07:40:43 +0000 (16:40 +0900)
committerSubhransu Mohanty <sub.mohanty@samsung.com>
Wed, 14 Nov 2018 07:48:49 +0000 (07:48 +0000)
gradient stops must be freed.

Change-Id: Ibc25e8e8e1c59762c0b757d15897a8ca5adf1f24

src/lottie/lottieitem.h

index 364da417317fcfa6b28f60f69990003525d45529..7cdf5fe27a9fcfadce54993dfde0af86d452298b 100644 (file)
@@ -160,6 +160,11 @@ public:
     void sync();
 public:
     std::unique_ptr<LOTNode>  mCNode;
+
+    ~LOTDrawable() {
+        if (mCNode.get()->mGradient.stopCount > 0)
+          free(mCNode.get()->mGradient.stopPtr);
+    }
 };
 
 class LOTPathDataItem;