remove exception log on app termination
authorYoung Ik Cho <youngik.cho@samsung.com>
Fri, 23 Aug 2013 01:24:06 +0000 (10:24 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Fri, 23 Aug 2013 01:24:06 +0000 (10:24 +0900)
Change-Id: I057650598cc6462940101a596366fde8a0b60d63
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/app/FApp_UiAppImpl.cpp

index b55ad62..42c64bc 100644 (file)
@@ -185,7 +185,7 @@ TransientResponseCb(void* pData)
 void
 _UiAppImpl::OnService(service_s* service, bool initial)
 {
-       Frame* pFrame = dynamic_cast<Frame*>(__pFrameList->GetAt(0));
+       Frame* pFrame = (__pFrameList) ? dynamic_cast<Frame*>(__pFrameList->GetAt(0)) : null;
        _EcoreEvas* pEvas = GetEcoreEvasMgr()->GetEcoreEvas();
 
        const int type = _AppInfo::GetAppType();
@@ -434,13 +434,16 @@ _UiAppImpl::GetAppFrame(void)
 result
 _UiAppImpl::RemoveFrame(const Frame& frame)
 {
-       result r = E_SUCCESS;
-       SysTryReturnResult(NID_APP, __pFrameList != null, E_INVALID_STATE, "Getting FrameList failed.");
+       if (__pFrameList == null)
+       {
+               SysLog(NID_APP, "No framelist available.");
+               return E_SUCCESS;
+       }
 
        Frame& tmpFrame = const_cast <Frame&>(frame);
        _WindowImpl* pFrameImpl = _WindowImpl::GetInstance(tmpFrame);
 
-       r = __pFrameList->Remove(frame, false);
+       const result r = __pFrameList->Remove(frame, false);
 
        if (pFrameImpl)
        {
@@ -454,8 +457,11 @@ _UiAppImpl::RemoveFrame(const Frame& frame)
 result
 _UiAppImpl::RemoveAllFrames(void)
 {
-       result r = E_SUCCESS;
-       SysTryReturnResult(NID_APP, __pFrameList != null, E_INVALID_STATE, "Getting FrameList failed.");
+       if (__pFrameList == null)
+       {
+               SysLog(NID_APP, "No framelist available.");
+               return E_SUCCESS;
+       }
 
        int frameCount = __pFrameList->GetCount();
        for (int i = 0; i < frameCount; i++)
@@ -479,7 +485,7 @@ _UiAppImpl::RemoveAllFrames(void)
        delete __pFrameList;
        __pFrameList = null;
 
-       return r;
+       return E_SUCCESS;
 }
 
 
@@ -493,13 +499,12 @@ _UiAppImpl::GetFrameList(void)
 Frame*
 _UiAppImpl::GetFrame(const String& name)
 {
-       Frame* pFrame = null;
        SysTryReturn(NID_APP, __pFrameList != null, null, E_INVALID_STATE, "[E_INVALID_STATE] Getting FrameList failed.");
        int frameCount = __pFrameList->GetCount();
 
        for (int i = 0; i < frameCount; i++)
        {
-               pFrame = dynamic_cast <Frame*>(__pFrameList->GetAt(i));
+               Frame* pFrame = dynamic_cast <Frame*>(__pFrameList->GetAt(i));
 
                if (pFrame != null && pFrame->GetName() == name)
                {
@@ -514,14 +519,13 @@ _UiAppImpl::GetFrame(const String& name)
 Frame*
 _UiAppImpl::GetFrameAt(int index)
 {
-       Frame* pFrame = null;
        SysTryReturn(NID_APP, __pFrameList != null, null, E_INVALID_STATE, "[E_INVALID_STATE] Getting FrameList failed.");
        SysTryReturn(NID_APP, index >= 0, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The index is less than 0.");
 
        int frameCount = __pFrameList->GetCount();
        SysTryReturn(NID_APP, index < frameCount, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The index is greater than the number of frames.");
 
-       pFrame = dynamic_cast <Frame*>(__pFrameList->GetAt(index));
+       Frame* pFrame = dynamic_cast <Frame*>(__pFrameList->GetAt(index));
 
        return pFrame;
 }