lottie/example: delete the animator only when its created. 44/186744/2
authorsubhransu mohanty <sub.mohanty@samsung.com>
Tue, 14 Aug 2018 05:28:46 +0000 (14:28 +0900)
committerHermet Park <chuneon.park@samsung.com>
Tue, 14 Aug 2018 10:08:33 +0000 (10:08 +0000)
Change-Id: Id6a4a7e704a8da298c0cae91a7065b80163f843d

example/lottieview.cpp
example/lottieview.h

index 6970191..5b30fd9 100644 (file)
@@ -108,7 +108,7 @@ LottieView::~LottieView()
     if (mRenderTask.valid())
         mRenderTask.get();
 
-    ecore_animator_del(mAnimator);
+    if (mAnimator) ecore_animator_del(mAnimator);
     if (mVg) evas_object_del(mVg);
     if (mImage) evas_object_del(mImage);
     delete mPlayer;
index 846610a..681fb8b 100644 (file)
@@ -55,7 +55,7 @@ public:
     int                      mRepeatCount;
     LottieView::RepeatMode   mRepeatMode;
     LOTPlayer               *mPlayer;
-    Ecore_Animator          *mAnimator;
+    Ecore_Animator          *mAnimator{nullptr};
     bool                     mLoop;
     int                      mCurCount;
     bool                     mReverse;