From 856005c91dde3474c33218fb4574936617c69b7f Mon Sep 17 00:00:00 2001 From: Duyoung Jang Date: Mon, 29 Apr 2013 19:49:37 +0900 Subject: [PATCH] Fix prevent issue Change-Id: Icc2ea3773e78a8117a894688895897bc78baeaac Signed-off-by: Duyoung Jang --- inc/InstallerDefs.h | 2 +- src/XmlHandler/ManifestGenerator.cpp | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/inc/InstallerDefs.h b/inc/InstallerDefs.h index fccdccb..f2a5df6 100755 --- a/inc/InstallerDefs.h +++ b/inc/InstallerDefs.h @@ -23,7 +23,7 @@ #include "InstallerUtil.h" -#define OSP_INSTALLER_VERSION "version=[20130429.2]" +#define OSP_INSTALLER_VERSION "version=[20130429.3]" #define DIR_BIN L"/bin" #define DIR_INFO L"/info" diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp index 932648a..976d046 100755 --- a/src/XmlHandler/ManifestGenerator.cpp +++ b/src/XmlHandler/ManifestGenerator.cpp @@ -342,21 +342,24 @@ ManifestGenerator::WriteLiveboxSizeValue(IMap* pList, const String& element, con { TryReturn(pList, false, "pList is null."); - IMapEnumerator* pMapEnum = pList->GetMapEnumeratorN(); + std::unique_ptr< IMapEnumerator > pMapEnum(pList->GetMapEnumeratorN()); TryReturn(pMapEnum, true, "pMapEnum is null."); while (pMapEnum->MoveNext() == E_SUCCESS) { - String* pSize = static_cast (pMapEnum->GetKey()); - if( pSize && IsValidLiveboxSize(*pSize) == false) + String* pSize = static_cast< String* > (pMapEnum->GetKey()); + TryReturn(pSize, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult())); + + if(IsValidLiveboxSize(*pSize) == false) { AppLog("The size %ls is ignored, because it's invalid for privilege level(%d) of the app.", pSize->GetPointer(), __pContext->__privilegeLevel); continue; } - String* pPriviewImage = static_cast (pMapEnum->GetValue()); + + String* pPriviewImage = static_cast< String* > (pMapEnum->GetValue()); __pWriter->StartElement(element); - if (pPriviewImage && (pPriviewImage->IsEmpty() == false)) + if (pPriviewImage && pPriviewImage->IsEmpty() == false) { String previewImagePath; previewImagePath.Format(1024, L"%ls/%ls", previewDir.GetPointer(), pPriviewImage->GetPointer()); @@ -366,7 +369,6 @@ ManifestGenerator::WriteLiveboxSizeValue(IMap* pList, const String& element, con __pWriter->EndElement(); } - delete pMapEnum; return true; } -- 2.7.4