[3.0] Prevention of Null pointer dereference 22/71022/1 accepted/tizen/common/20160524.150503 submit/tizen/20160524.015112
authorminho.sun <minho.sun@samsung.com>
Wed, 18 May 2016 02:14:22 +0000 (11:14 +0900)
committerminho.sun <minho.sun@samsung.com>
Wed, 18 May 2016 02:14:26 +0000 (11:14 +0900)
This reverts commit 11ee80a1e974b67b88ec22d4bdad41a4c362ebe1.

Change-Id: I9ced74839e441e8472b293d7ba5d5fdf7aa7d297

dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp

index a3eac2cb77613c41227b7dd200f1783878699699..021216179557005d3824efb7e4bcb40638860f67 100644 (file)
@@ -1392,27 +1392,28 @@ Toolkit::AccessibilityManager::FocusedActorActivatedSignalType& AccessibilityMan
 
 bool AccessibilityManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
-  Dali::BaseHandle handle( object );
-
   bool connected( true );
   AccessibilityManager* manager = dynamic_cast<AccessibilityManager*>( object );
 
-  if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
-  {
-    manager->FocusChangedSignal().Connect( tracker, functor );
-  }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_OVERSHOT ) )
-  {
-    manager->FocusOvershotSignal().Connect( tracker, functor );
-  }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
+  if( manager )
   {
-    manager->FocusedActorActivatedSignal().Connect( tracker, functor );
-  }
-  else
-  {
-    // signalName does not match any signal
-    connected = false;
+    if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
+    {
+      manager->FocusChangedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_OVERSHOT ) )
+    {
+      manager->FocusOvershotSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
+    {
+      manager->FocusedActorActivatedSignal().Connect( tracker, functor );
+    }
+    else
+    {
+      // signalName does not match any signal
+      connected = false;
+    }
   }
 
   return connected;
index 9f5d27a3089c877bfeaf153ee876c4129cd833d4..cdcc8e26f7dbe91e8c09d499668dec6759ad156b 100644 (file)
@@ -228,23 +228,24 @@ void KeyInputFocusManager::OnObjectDestroyed( const Dali::RefObject* object )
 
 bool KeyInputFocusManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
-  Dali::BaseHandle handle( object );
-
   bool connected( true );
   KeyInputFocusManager* manager = dynamic_cast<KeyInputFocusManager*>( object );
 
-  if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_CHANGED ) )
-  {
-    manager->KeyInputFocusChangedSignal().Connect( tracker, functor );
-  }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_UNHANDLED_KEY_EVENT ) )
-  {
-    manager->UnhandledKeyEventSignal().Connect( tracker, functor );
-  }
-  else
+  if( manager )
   {
-    // signalName does not match any signal
-    connected = false;
+    if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_CHANGED ) )
+    {
+      manager->KeyInputFocusChangedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_UNHANDLED_KEY_EVENT ) )
+    {
+      manager->UnhandledKeyEventSignal().Connect( tracker, functor );
+    }
+    else
+    {
+      // signalName does not match any signal
+      connected = false;
+    }
   }
 
   return connected;