Memory Leak fixed in Searchbar
authorAyush <ayush.sriv@samsung.com>
Wed, 10 Jul 2013 12:08:44 +0000 (17:38 +0530)
committerAyush <ayush.sriv@samsung.com>
Wed, 10 Jul 2013 12:26:15 +0000 (17:56 +0530)
Change-Id: I130320064a554b04a2a256348b7fea80d4f1a95d
Signed-off-by: Ayush <ayush.sriv@samsung.com>
src/ui/controls/FUiCtrl_SearchBarImpl.cpp

index baeee13..9abfaf8 100644 (file)
@@ -69,6 +69,23 @@ _SearchBarImpl::~_SearchBarImpl(void)
        if (__pSearchBar)
        {
                SetContent(null);
+               if (__pSearchBar->GetClippedGroupControl())
+               {
+                       _Control* pControl = __pSearchBar->GetClippedGroupControl();
+                       pControl->DetachAllChildren();
+               }
+       }
+
+       if (__pEditField)
+       {
+               delete __pEditField;
+               __pEditField = null;
+       }
+
+       if (__pButton)
+       {
+               delete __pButton;
+               __pButton = null;
        }
 
        if (__pPublicActionEvent)
@@ -101,25 +118,10 @@ _SearchBarImpl::~_SearchBarImpl(void)
                __pPublicSearchBarEvent = null;
        }
 
-       if (__pSearchBar)
-       {
-               if (__pSearchBar->GetClippedGroupControl())
-               {
-                       _Control* pControl = __pSearchBar->GetClippedGroupControl();
-                       pControl->DetachAllChildren();
-               }
-       }
-
-       if (__pEditField)
-       {
-               delete __pEditField;
-               __pEditField = null;
-       }
-
-       if (__pButton)
+       if (__pPublicLanguageEvent)
        {
-               delete __pButton;
-               __pButton = null;
+               delete __pPublicLanguageEvent;
+               __pPublicLanguageEvent = null;
        }
 
        if (__pPublicFocusEventListeners)