Fixed memory leaks
authorHimanshu <himanshu.t@samsung.com>
Tue, 2 Jul 2013 12:25:17 +0000 (17:55 +0530)
committerHimanshu <himanshu.t@samsung.com>
Tue, 2 Jul 2013 12:25:17 +0000 (17:55 +0530)
Change-Id: I195bce9ef3b8e18a8aff4b674e0ad7d513dbec92
Signed-off-by: Himanshu <himanshu.t@samsung.com>
src/GlBaseForm.cpp
src/GlFileListEditorForm.cpp
src/GlThumbnailProvider.cpp

index 6c58453..3c0ce24 100644 (file)
@@ -89,6 +89,10 @@ BaseForm::GetMoveFileIndexList(String& moveDir, IList* pMoveIndexList, FileListP
                                }
                        }
                }
+
+               pCollisionList->RemoveAll(true);
+               delete pCollisionList;
+
                if ( collisionCount > 0)
                {
                        MessageBox messageBox;
index a50116b..85a0864 100644 (file)
@@ -92,7 +92,9 @@ FileListEditorForm::~FileListEditorForm(void)
 
        if (__pContentDirectoryNameList != null)
        {
+               __pContentDirectoryNameList->RemoveAll(true);
                delete __pContentDirectoryNameList;
+               __pContentDirectoryNameList = null;
        }
        delete __pFileMove;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -278,6 +280,7 @@ FileListEditorForm::InitializeFooter(void)
 
                if (__pContentDirectoryNameList != null)
                {
+                       __pContentDirectoryNameList->RemoveAll(true);
                        delete __pContentDirectoryNameList;
                        __pContentDirectoryNameList = null;
                }
@@ -937,8 +940,17 @@ FileListEditorForm::RefreshFolderList(void)
        {
                __pContentDirectoryList->RemoveAll(true);
                delete __pContentDirectoryList;
+               __pContentDirectoryList = null;
        }
        __pContentDirectoryList = contentDirectory.GetContentDirectoryPathListN(SORT_ORDER_NONE);
+
+       if ( __pContentDirectoryNameList != NULL)
+       {
+               __pContentDirectoryNameList->RemoveAll(true);
+               delete __pContentDirectoryNameList;
+               __pContentDirectoryNameList = null;
+       }
+
        __pContentDirectoryNameList = new (std::nothrow) ArrayList(SingleObjectDeleter);
        String* pDirPath = null;
        String* pDirName = null;
index fe8f230..cb2a68e 100644 (file)
@@ -358,6 +358,7 @@ ThumbnailProvider::GetThumbnailInfoN(const ContentId& contentId) const
                        pNewThumbnailInfo = new (std::nothrow) ThumbnailInfo();
                        pNewThumbnailInfo->Construct(contentId, pContentInfo->GetContentPath(), *pBitmap, contentType, duration);
                        delete pBitmap;
+                       delete pContentInfo;
                }
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));