From: subhransu mohanty Date: Tue, 18 Dec 2018 08:56:24 +0000 (+0900) Subject: lottie/memoryleak: Destory the player handle properly in capi destroy() implementation. X-Git-Tag: accepted/tizen/unified/20181227.062023~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=d1c3b19e01a2dbcbb1bd78252123fc92c32a4dd9;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/memoryleak: Destory the player handle properly in capi destroy() implementation. Change-Id: Ie3a2b8d619e6e7c038c4296789952ecb4653b12f --- diff --git a/src/binding/c/lottieanimation_capi.cpp b/src/binding/c/lottieanimation_capi.cpp index 427135c..7de388b 100644 --- a/src/binding/c/lottieanimation_capi.cpp +++ b/src/binding/c/lottieanimation_capi.cpp @@ -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)