Fixed memory leaks
authorHongryeol Gil <hr.gil@samsung.com>
Fri, 19 Apr 2013 10:32:30 +0000 (19:32 +0900)
committerHongryeol Gil <hr.gil@samsung.com>
Fri, 19 Apr 2013 10:32:30 +0000 (19:32 +0900)
Change-Id: I38647a825a809e2ac9a64982fd45c0481af38626
Signed-off-by: Hongryeol Gil <hr.gil@samsung.com>
src/StWallpaperAlbumListPresentationModel.cpp

index d34125a..f3f8bdd 100644 (file)
@@ -210,8 +210,8 @@ WallpaperAlbumListPresentationModel::DrawPartialImage(Canvas& canvas, AlbumInfo*
                                ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER,
                                ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER);
                r = canvas.DrawBitmap(rectFirst, *pBitmap1);
+               delete pBitmap1;
        }
-       delete pBitmap1;
        delete pContentInfo;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
@@ -343,7 +343,6 @@ WallpaperAlbumListPresentationModel::CreateDetailMergeBitmapN(int index)
 
        if (pContentInfo == null)
        {
-               delete pContentInfo;
                AppLogDebug("pContentInfo is null");
                delete pBitmapNew;
                return null;
@@ -367,10 +366,10 @@ WallpaperAlbumListPresentationModel::CreateDetailMergeBitmapN(int index)
                                ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER);
                canvas.FillRectangle(COLOR_BG_GROUP_ITEM_DEFAULT, canvasRect);
                r = canvas.DrawBitmap(rectFirst, *pBitmap);
+               delete pBitmap;
        }
        pBitmapNew->Unlock();
        delete pContentInfo;
-       delete pBitmap;
 
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
        return pBitmapNew;
@@ -466,6 +465,8 @@ WallpaperAlbumListPresentationModel::GetMinMaxDateTimeString(IList* pContentIdLi
                        }
 
                        DateTime dateFileTime = pContentInfo->GetDateTime();
+                       delete pContentInfo;
+                       pContentInfo = null;
 
                        if (count == 0)
                        {