Fix prevent issue
authorDuyoung Jang <duyoung.jang@samsung.com>
Mon, 29 Apr 2013 10:49:37 +0000 (19:49 +0900)
committerDuyoung Jang <duyoung.jang@samsung.com>
Mon, 29 Apr 2013 11:01:11 +0000 (20:01 +0900)
Change-Id: Icc2ea3773e78a8117a894688895897bc78baeaac
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
inc/InstallerDefs.h
src/XmlHandler/ManifestGenerator.cpp

index fccdccb..f2a5df6 100755 (executable)
@@ -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"
index 932648a..976d046 100755 (executable)
@@ -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<String*> (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<String*> (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;
 }