From: Woowon Date: Mon, 6 May 2013 05:13:27 +0000 (+0900) Subject: Fix Jira issue about N_SE-37462 X-Git-Tag: submit/tizen_2.1/20130514.054242~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80f93d4d101475b7cf136ee81e197e5588b9b37b;p=framework%2Fosp%2Fnfc.git Fix Jira issue about N_SE-37462 Change-Id: Ia7e4e7bc1f644688cadbeed97061830d0b3e8cb4 Signed-off-by: Woowon --- diff --git a/src/FNetNfc_NfcManagerImpl.cpp b/src/FNetNfc_NfcManagerImpl.cpp index e8533d1..c14d4b0 100644 --- a/src/FNetNfc_NfcManagerImpl.cpp +++ b/src/FNetNfc_NfcManagerImpl.cpp @@ -87,43 +87,49 @@ _NfcManagerImpl::~_NfcManagerImpl(void) delete __pCurrentTagImpl; delete __pMgrEvent; - unique_ptr pTagConditionList(__pTagConditionMap->GetValuesN()); - unique_ptr pTagConditionEnum(pTagConditionList->GetEnumeratorN()); - while (pTagConditionEnum->MoveNext() == E_SUCCESS) + if (__pTagConditionMap) { - _NfcTagEventMap* pEventMap = dynamic_cast <_NfcTagEventMap*> (pTagConditionEnum->GetCurrent()); - if (pEventMap) + unique_ptr pTagConditionList(__pTagConditionMap->GetValuesN()); + unique_ptr pTagConditionEnum(pTagConditionList->GetEnumeratorN()); + while (pTagConditionEnum->MoveNext() == E_SUCCESS) { - unique_ptr > pEventList(pEventMap->GetValuesN()); - unique_ptr > pEventEnum(pEventList->GetEnumeratorN()); - while (pEventEnum->MoveNext() == E_SUCCESS) + _NfcTagEventMap* pEventMap = dynamic_cast <_NfcTagEventMap*> (pTagConditionEnum->GetCurrent()); + if (pEventMap) { - _NfcTagDiscoveryEvent* pEvent = null; - pEventEnum->GetCurrent(pEvent); - delete pEvent; + unique_ptr > pEventList(pEventMap->GetValuesN()); + unique_ptr > pEventEnum(pEventList->GetEnumeratorN()); + while (pEventEnum->MoveNext() == E_SUCCESS) + { + _NfcTagDiscoveryEvent* pEvent = null; + pEventEnum->GetCurrent(pEvent); + delete pEvent; + } } } + delete __pTagConditionMap; } - delete __pTagConditionMap; - unique_ptr pNdefConditionList(__pNdefConditionMap->GetValuesN()); - unique_ptr pNdefConditionEnum(pNdefConditionList->GetEnumeratorN()); - while (pNdefConditionEnum->MoveNext() == E_SUCCESS) + if (__pNdefConditionMap) { - _NdefMsgEventMap* pEventMap = dynamic_cast <_NdefMsgEventMap*> (pNdefConditionEnum->GetCurrent()); - if (pEventMap) + unique_ptr pNdefConditionList(__pNdefConditionMap->GetValuesN()); + unique_ptr pNdefConditionEnum(pNdefConditionList->GetEnumeratorN()); + while (pNdefConditionEnum->MoveNext() == E_SUCCESS) { - unique_ptr > pEventList(pEventMap->GetValuesN()); - unique_ptr > pEventEnum(pEventList->GetEnumeratorN()); - while (pEventEnum->MoveNext() == E_SUCCESS) + _NdefMsgEventMap* pEventMap = dynamic_cast <_NdefMsgEventMap*> (pNdefConditionEnum->GetCurrent()); + if (pEventMap) { - _NdefMessageDiscoveryEvent* pEvent = null; - pEventEnum->GetCurrent(pEvent); - delete pEvent; + unique_ptr > pEventList(pEventMap->GetValuesN()); + unique_ptr > pEventEnum(pEventList->GetEnumeratorN()); + while (pEventEnum->MoveNext() == E_SUCCESS) + { + _NdefMessageDiscoveryEvent* pEvent = null; + pEventEnum->GetCurrent(pEvent); + delete pEvent; + } } } + delete __pNdefConditionMap; } - delete __pNdefConditionMap; delete __pDeviceDiscoveryEvent; }