Revert "[3.0] Prevention of Null pointer dereference" 73/72273/1
authorsuhyung Eom <suhyung.eom@samsung.com>
Tue, 31 May 2016 08:56:52 +0000 (17:56 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Tue, 31 May 2016 08:57:13 +0000 (17:57 +0900)
This reverts commit e23c271720be0317abf731e87d33ec73e96eda2a.
Change-Id: Iad476659a4edd1402269fea913e75ccf9eef98be

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

index 0212161..a3eac2c 100644 (file)
@@ -1392,28 +1392,27 @@ 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( manager )
+  if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
   {
-    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;
-    }
+    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 cdcc8e2..9f5d27a 100644 (file)
@@ -228,24 +228,23 @@ 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( manager )
+  if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_CHANGED ) )
   {
-    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;
-    }
+    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;