From: shivakumar jagalur matt Date: Wed, 31 Jul 2013 11:42:17 +0000 (+0530) Subject: Fix For N_SE-47621 X-Git-Tag: submit/tizen_2.2/20131107.062046~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6028c3256b191751002386ac83142f2a30e2b06;p=framework%2Fosp%2Fmessaging.git Fix For N_SE-47621 Change-Id: Ic9c9d047d8436014937b7ad95faa8eb8ca169da1 Signed-off-by: shivakumar jagalur matt --- diff --git a/src/FMsg_SmsMmsCallbackHandler.cpp b/src/FMsg_SmsMmsCallbackHandler.cpp index b34b160..ab61ce0 100644 --- a/src/FMsg_SmsMmsCallbackHandler.cpp +++ b/src/FMsg_SmsMmsCallbackHandler.cpp @@ -90,12 +90,67 @@ _SmsMmsCallbackHandler::~_SmsMmsCallbackHandler(void) msg_close_msg_handle(&__msgHandle); __msgHandle = 0; } + + Tizen::Base::Collection::IList* pKeyList = null; + Integer* pKey = null; + Integer* pMsgType = null; + IEnumerator* pValueEnum = null; + int count = 0; + + __msgMutex.Acquire(); + + if (__messageMap.GetCount()) + { + pKeyList = __messageMap.GetKeysN(); + count = pKeyList->GetCount(); + } + + // Manually deleting key and value pairs + for (int index = 0; index < count; index++) + { + pKey = static_cast (pKeyList->GetAt(index)); + pValueEnum = __messageMap.GetValuesN(*pKey); + + if (pValueEnum) + { + if (pValueEnum->MoveNext() == E_SUCCESS) + { + pMsgType = static_cast (pValueEnum->GetCurrent()); + + if (pMsgType) + { + delete pMsgType; + pMsgType = null; + } + } + } - if (__messageMap.GetCount()) + if (pKey) + { + delete pKey; + pKey = null; + } + + if (pValueEnum) + { + delete pValueEnum; + pValueEnum = null; + } + } + + if (pKeyList) + { + delete pKeyList; + pKeyList = null; + } + + if (__messageMap.GetCount()) { - __messageMap.RemoveAll(true); + __messageMap.RemoveAll(false); } + __msgMutex.Release(); + if (__cbsSettingsHandle) { msg_release_struct(&__cbsSettingsHandle);