lottie/memoryleak: Destory the player handle properly in capi destroy() implementation.

Change-Id: Ie3a2b8d619e6e7c038c4296789952ecb4653b12f
This commit is contained in:
subhransu mohanty 2018-12-18 17:56:24 +09:00
parent 820b61b3c0
commit d1c3b19e01

View 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)