From 8dd072cea384d6c48becf4482a60d3428c7f1373 Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Wed, 14 May 2014 17:52:19 +0100 Subject: [PATCH] Fixed crash when KeyboardFocusManager clears the focus [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. --- .../internal/focus-manager/keyboard-focus-manager-impl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp b/base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp index 7b1d929..193d985 100644 --- a/base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -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() ) -- 2.7.4