Fixed crash occurred when a listner does not exist tizen_2.1 accepted/tizen/20130520.101549 submit/tizen/20130517.045600 submit/tizen_2.1/20130516.045718
authorJaehwan Lee <jh8379.lee@samsung.com>
Mon, 13 May 2013 13:45:33 +0000 (22:45 +0900)
committerJaehwan Lee <jh8379.lee@samsung.com>
Mon, 13 May 2013 13:49:11 +0000 (22:49 +0900)
Change-Id: If1e121987866bf9596dd99ea4e6f19965e1d2ee3
Signed-off-by: Jaehwan Lee <jh8379.lee@samsung.com>
src/FTel_SimStateManagerImpl.cpp

index 734c126..78b9beb 100644 (file)
@@ -213,10 +213,14 @@ _SimStateManagerImpl::OnSimStateChangedCallback(TapiHandle* pHandle, const char*
        {
                pSimStateManagerImpl->__simState = state;
 
-               _SimEventArg* pEventArg = new (std::nothrow)_SimEventArg(_SIM_EVENT_SIM_STATE_CHANGED, state);
-               SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+               if (pSimStateManagerImpl->__pSimEvent != null)
+               {
 
-               (void)pSimStateManagerImpl->__pSimEvent->Fire(*pEventArg);
+                       _SimEventArg* pEventArg = new (std::nothrow)_SimEventArg(_SIM_EVENT_SIM_STATE_CHANGED, state);
+                       SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+                       (void)pSimStateManagerImpl->__pSimEvent->Fire(*pEventArg);
+               }
        }
 }
 
@@ -259,10 +263,14 @@ _SimStateManagerImpl::OnGetPinLockSettingCallback(TapiHandle* pHandle, int ret,
        _SimStateManagerImpl* pSimStateManagerImpl = static_cast<_SimStateManagerImpl*>(pUserData);
        pSimStateManagerImpl->__isInProgress = false;
 
-       _SimManagerEventArg* pEventArg = new (std::nothrow)_SimManagerEventArg(_SIM_MANAGER_EVENT_PIN_LOCK_SETTING_RESULT_RECEIVED, isEnabled, r);
-       SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       (void)pSimStateManagerImpl->__pSimManagerEvent->Fire(*pEventArg);
+       if (pSimStateManagerImpl->__pSimManagerEvent != null)
+       {
+               _SimManagerEventArg* pEventArg = new (std::nothrow)_SimManagerEventArg(_SIM_MANAGER_EVENT_PIN_LOCK_SETTING_RESULT_RECEIVED, isEnabled, r);
+               SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+               (void)pSimStateManagerImpl->__pSimManagerEvent->Fire(*pEventArg);
+       }
 }
 
 result