Fixed crash when KeyboardFocusManager clears the focus
authorRichard Huang <r.huang@samsung.com>
Wed, 14 May 2014 16:52:19 +0000 (17:52 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 27 May 2014 14:35:53 +0000 (15:35 +0100)
[problem] There is crash if focus indicator is empty but KeyboardFocusManager
          tries to clear the focus.
[cause] It doesn't check whether focus indicator exists before remove it from
        the current focused actor.
[solution] Check whether focus indicator exists before remove it.

base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp

index 7b1d929..193d985 100644 (file)
@@ -341,7 +341,10 @@ void KeyboardFocusManager::ClearFocus()
   Actor actor = GetCurrentFocusActor();
   if(actor)
   {
-    actor.Remove(mFocusIndicatorActor);
+    if(mFocusIndicatorActor)
+    {
+      actor.Remove(mFocusIndicatorActor);
+    }
 
     // Send notification for the change of focus actor
     if( !mFocusChangedSignalV2.Empty() )