Fix prevent issue
authorDuyoung Jang <duyoung.jang@samsung.com>
Mon, 12 Aug 2013 06:57:23 +0000 (15:57 +0900)
committerDuyoung Jang <duyoung.jang@samsung.com>
Mon, 12 Aug 2013 06:57:23 +0000 (15:57 +0900)
Change-Id: Ic60722afb00466c41b1e2e937011e0b96581913e
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
inc/InstallerDefs.h
src/Step/UninstallStep.cpp
src/XmlHandler/ManifestHandler.cpp

index 906fe91..427e7b5 100755 (executable)
@@ -23,7 +23,7 @@
 
 #include "InstallerUtil.h"
 
-#define OSP_INSTALLER_VERSION "version=[20130807.2]"
+#define OSP_INSTALLER_VERSION "version=[20130812.1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index 55306e8..02cd5b0 100755 (executable)
@@ -174,27 +174,26 @@ UninstallStep::OnStateGetPackageInfo(void)
                AppLog("[app2sd] pre_uninstall(%s)", pPackageId.get());
        }
 
-       ArrayList* pList = pPackageInfoImpl->GetAppInfoListN();
+       std::unique_ptr< ArrayList > pList(pPackageInfoImpl->GetAppInfoListN());
        TryReturn(pList, INSTALLER_ERROR_DATABASE, "pList is null.");
 
-       for (int i = 0; i < pList->GetCount(); i++)
+       for (int i = 0; i < pList.get()->GetCount(); i++)
        {
-               _PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pList->GetAt(i));
+               _PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pList.get()->GetAt(i));
                if (pAppInfoImpl)
                {
-                       AppData* pAppData = new (std::nothrow) AppData;
-                       TryReturn(pAppData, INSTALLER_ERROR_OUT_OF_MEMORY, "pAppData is null");
+                       std::unique_ptr< AppData > pAppData(new (std::nothrow) AppData);
+                       TryReturn(pAppData, INSTALLER_ERROR_OUT_OF_MEMORY, "pAppData is null.");
 
-                       error = pAppData->Construct();
-                       TryReturn(error == INSTALLER_ERROR_NONE, INSTALLER_ERROR_INTERNAL_STATE, "pAppData->Construct() failed.");
+                       error = pAppData.get()->Construct();
+                       TryReturn(error == INSTALLER_ERROR_NONE, INSTALLER_ERROR_INTERNAL_STATE, "pAppData.get()->Construct() failed.");
 
-                       pAppData->__appId = pAppInfoImpl->GetPackageName();
-                       pAppData->__feature = pAppInfoImpl->GetAppFeature();
+                       pAppData.get()->__appId = pAppInfoImpl->GetPackageName();
+                       pAppData.get()->__feature = pAppInfoImpl->GetAppFeature();
 
-                       __pContext->__pAppDataList->Add(pAppData);
+                       __pContext->__pAppDataList->Add(pAppData.release());
                }
        }
-       delete pList;
 
        GoNextState();
        return error;
index 6335cda..69692dd 100755 (executable)
@@ -1219,21 +1219,24 @@ ManifestHandler::OnDataControlTypeValue(const char* pCharacters)
 bool
 ManifestHandler::OnConditionValue(const char* pCharacters)
 {
-       XmlAttribute *pAttr = null;
-       char *pName = null;
+       result r = E_SUCCESS;
+       XmlAttribute* pAttr = null;
+       char* pName = null;
 
        pAttr = GetAttribute();
-       TryReturn(pAttr, true, "pAttr is null");
+       TryReturn(pAttr, true, "pAttr is null.");
 
        pName = pAttr->Find("Name");
-       TryReturn(pName, true, "pName is null");
+       TryReturn(pName, true, "pName is null.");
 
        String* pKey = new (std::nothrow) String(pName);
-       TryReturn(pKey, false, "pKey is null");
+       TryReturn(pKey, false, "pKey is null.");
        String* pValue = new (std::nothrow) String(pCharacters);
-       TryReturn(pValue, false, "pValue is null");
+       TryReturn(pValue, false, "pValue is null.");
+
+       r = __pAppData->__pLaunchConditionList->Add(pKey, pValue);
+       TryReturn(r == E_SUCCESS, false, "__pLaunchConditionList->Add(%s, %s) failed.", pName, pCharacters);
 
-       __pAppData->__pLaunchConditionList->Add(pKey, pValue);
        AppLog("<LaunchCondition Name=\"%s\", Value=\"%s\">", pName, pCharacters);
 
        return true;