#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"
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;
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;