SysTryReturn(NID_APP, pPkgMgrImpl != null, null, E_SYSTEM,
"[%s] A system error has been occurred. failed to get _PackageMaangerImpl.", GetErrorMessage(E_SYSTEM));
- PackageInfo* pPackageInfo = null;
- pPackageInfo = pPkgMgrImpl->GetPackageInfoN(packageId); // !E_SUCCESS for DB fail and query fail
+ std::unique_ptr<PackageInfo> pPackageInfo(pPkgMgrImpl->GetPackageInfoN(packageId)); // !E_SUCCESS for DB fail and query fail
SysTryReturn(NID_APP, pPackageInfo != null, null, E_APP_NOT_INSTALLED, "[%s] Propagating.", GetErrorMessage(E_APP_NOT_INSTALLED));
- const _PackageInfoImpl* pPkgInfoImpl = _PackageInfoImpl::GetInstance(pPackageInfo);
+ const _PackageInfoImpl* pPkgInfoImpl = _PackageInfoImpl::GetInstance(pPackageInfo.get());
SysTryReturn(NID_APP, pPkgInfoImpl != null, null, E_SYSTEM,
"[%s] A system error has been occurred. failed to get _PackageInfoImpl.", GetErrorMessage(E_SYSTEM));
CATCH:
delete pAppSettingInstance;
- delete pPackageInfo;
return null;
}