fix animations of duplicated property was not deleted
authorHyeJin Lee <hyejin79.lee@samsung.com>
Mon, 25 Mar 2013 08:14:25 +0000 (17:14 +0900)
committerHyeJin Lee <hyejin79.lee@samsung.com>
Mon, 25 Mar 2013 08:17:14 +0000 (17:17 +0900)
Change-Id: I15565823eba1e82bc567fb05f727422cae3ffeaa

src/ui/animations/FUiAnim_AnimationManager.cpp
src/ui/animations/FUiAnim_AnimationManager.h
src/ui/animations/FUiAnim_TransactionNode.cpp

index d0bb606..c469bbf 100644 (file)
@@ -181,6 +181,7 @@ _AnimationManager::_AnimationManager(void)
 
 _AnimationManager::~_AnimationManager(void)
 {
+       __committedList.RemoveAllNodes();
 }
 
 _AnimationManager*
@@ -505,7 +506,7 @@ _AnimationManager::BeginTransaction(void)
 
        if (__pCurrentTransaction == null)
        {
-               pNode = new (std::nothrow) _TransactionNode();
+               pNode = new (std::nothrow) _TransactionNode(*__pRootTransaction);
                SysTryReturn(NID_UI_ANIM, (pNode != null), -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. Failed to create _TransactionNode.");
 
                result r = GetLastResult();
index 21c36b3..4386faa 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <FUiAnimVisualElement.h>
 
+#include "FUiAnim_TransactionNode.h"
 
 namespace Tizen { namespace Ui { namespace Animations
 {
@@ -40,8 +41,6 @@ class IVisualElementAnimationTimingFunction;
 class IVisualElementAnimationValueInterpolator;
 class VisualElementAnimation;
 class VisualElementAnimationGroup;
-class _RootVisualElement;
-class _TransactionNode;
 
 class _AnimationManager
 {
@@ -106,11 +105,11 @@ private:
        public:
                _TransactionNode* GetNodeAt(int index) const
                {
-                       _TransactionNode* pChild = null;
+                       _TransactionNode* pNode = null;
 
-                       if (likely(GetAt(index, pChild) == E_SUCCESS))
+                       if (likely(GetAt(index, pNode) == E_SUCCESS))
                        {
-                               return pChild;
+                               return pNode;
                        }
 
                        return null;
@@ -121,27 +120,25 @@ private:
                        return (GetCount() <= 0);
                }
 
-/*
-               void RemoveAllChildren(void)
+               void RemoveAllNodes(void)
                {
-                       _TransactionNode* pChild = null;
+                       _TransactionNode* pNode = null;
 
-                       int childrenCount = GetCount();
+                       int nodeCount = GetCount();
 
-                       for (int index = 0; index < childrenCount; index++)
+                       for (int index = 0; index < nodeCount; index++)
                        {
-                               if (likely(GetAt(index, pChild) == E_SUCCESS))
+                               if (likely(GetAt(index, pNode) == E_SUCCESS))
                                {
-                                       delete pChild;
+                                       delete pNode;
                                }
                        }
 
                        RemoveAll();
-               }*/
+               }
        };
 
        CommittedListT __committedList;
-//     Tizen::Base::Collection::ArrayListT<_TransactionNode*> __committedList;
 
        IAnimationTransactionEventListener* __pDefaultTransactionEventListener;
        const IVisualElementAnimationTimingFunction* __pDefaultTimingFunction;
index 286f18c..178f2a0 100644 (file)
@@ -797,7 +797,7 @@ _TransactionNode::RemoveChild(_TransactionNode& child)
        }
        else
        {
-               result r = __children.Remove(&child);
+               __children.Remove(&child);
                delete &child;
 
                return true;
@@ -1237,8 +1237,6 @@ _TransactionNode::RemoveChildrenAllAnimations(VisualElement& target)
 {
        RemoveAllAnimations(target);
 
-       RemoveAllAnimations(target);
-
        if (GetChildrenCount() <= 0)
        {
                return;