From 764f5ec118ecfc0731f001b3cb17e689a0f2561d Mon Sep 17 00:00:00 2001 From: Himanshu Date: Tue, 25 Jun 2013 17:43:02 +0530 Subject: [PATCH] Fixed prevent issues Change-Id: I6f2dc3e2f19f7fe7ad1654d48ca84207aff595ae Signed-off-by: Himanshu --- src/GlAlbumListPresentationModel.cpp | 25 +++++-------------------- src/GlAlbumNameEditorForm.cpp | 1 + src/GlFileListPresentationModel.cpp | 29 +++++++++++++++-------------- 3 files changed, 21 insertions(+), 34 deletions(-) diff --git a/src/GlAlbumListPresentationModel.cpp b/src/GlAlbumListPresentationModel.cpp index ae0007b..ebcca82 100644 --- a/src/GlAlbumListPresentationModel.cpp +++ b/src/GlAlbumListPresentationModel.cpp @@ -780,26 +780,11 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy return; CATCH: - if (pContentDirectoryPathList != null) - { - delete pContentDirectoryPathList; - } - if (pAllAlbumInfo != null) - { - delete pAllAlbumInfo; - } - if (pCameraAlbumInfo != null) - { - delete pCameraAlbumInfo; - } - if (pDownloadAlbumInfo != null) - { - delete pDownloadAlbumInfo; - } - if (pNoNameAlbumInfo != null) - { - delete pNoNameAlbumInfo; - } + delete pContentDirectoryPathList; + delete pAllAlbumInfo; + delete pCameraAlbumInfo; + delete pDownloadAlbumInfo; + delete pNoNameAlbumInfo; } String diff --git a/src/GlAlbumNameEditorForm.cpp b/src/GlAlbumNameEditorForm.cpp index 15d6c36..4c76280 100644 --- a/src/GlAlbumNameEditorForm.cpp +++ b/src/GlAlbumNameEditorForm.cpp @@ -538,6 +538,7 @@ AlbumNameEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, } delete pEnum; delete pArgs; + pArgs = NULL ; } } diff --git a/src/GlFileListPresentationModel.cpp b/src/GlFileListPresentationModel.cpp index d71a4eb..5fde925 100644 --- a/src/GlFileListPresentationModel.cpp +++ b/src/GlFileListPresentationModel.cpp @@ -1588,27 +1588,28 @@ FileListPresentationModel::RotateImage(int index, RotateMode rotateMode) if (r == E_SUCCESS) { imageFormat = img.GetImageFormat(filePath); - } - r = rotateBuffer.Construct(filePath); - if (r == E_SUCCESS) - { - if (rotateMode == ROTATE_MODE_RIGHT) + r = rotateBuffer.Construct(filePath); + if (r == E_SUCCESS) { - pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_90); + if (rotateMode == ROTATE_MODE_RIGHT) + { + pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_90); + } + else + { + pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_270); + } } - else + + if (pRotatedBuffer != null) { - pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_270); + r = pRotatedBuffer->EncodeToFile(filePath, imageFormat, true, 100); + delete pRotatedBuffer; + ContentManager::ScanFile(filePath); } } - if (pRotatedBuffer != null) - { - r = pRotatedBuffer->EncodeToFile(filePath, imageFormat, true, 100); - delete pRotatedBuffer; - ContentManager::ScanFile(filePath); - } return r; } -- 2.7.4