lottie/memoryleak: Destory the player handle properly in capi destroy() implementation. 15/195815/1
authorsubhransu mohanty <sub.mohanty@samsung.com>
Tue, 18 Dec 2018 08:56:24 +0000 (17:56 +0900)
committersubhransu mohanty <sub.mohanty@samsung.com>
Tue, 18 Dec 2018 08:56:24 +0000 (17:56 +0900)
Change-Id: Ie3a2b8d619e6e7c038c4296789952ecb4653b12f

src/binding/c/lottieanimation_capi.cpp

index 427135c..7de388b 100644 (file)
@@ -36,8 +36,13 @@ LOT_EXPORT Lottie_Animation_S *lottie_animation_from_data(const char *data, cons
 
 LOT_EXPORT void lottie_animation_destroy(Lottie_Animation_S *animation)
 {
-    if (animation)
+    if (animation) {
+        if (animation->mRenderTask.valid()) {
+            animation->mRenderTask.get();
+        }
+        animation->mAnimation = nullptr;
         delete animation;
+    }
 }
 
 LOT_EXPORT void lottie_animation_get_size(const Lottie_Animation_S *animation, size_t *width, size_t *height)