Fix For N_SE-47621
authorshivakumar jagalur matt <shiva.jm@samsung.com>
Wed, 31 Jul 2013 11:42:17 +0000 (17:12 +0530)
committershivakumar jagalur matt <shiva.jm@samsung.com>
Wed, 31 Jul 2013 11:42:17 +0000 (17:12 +0530)
Change-Id: Ic9c9d047d8436014937b7ad95faa8eb8ca169da1
Signed-off-by: shivakumar jagalur matt <shiva.jm@samsung.com>
src/FMsg_SmsMmsCallbackHandler.cpp

index b34b160..ab61ce0 100644 (file)
@@ -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 <Integer*>(pKeyList->GetAt(index));
+               pValueEnum = __messageMap.GetValuesN(*pKey);
+
+               if (pValueEnum)
+               {
+                       if (pValueEnum->MoveNext() == E_SUCCESS)
+                       {
+                               pMsgType = static_cast <Integer*>(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);