std::unique_ptr<ci::AppInstaller> HybridInstallerFactory::CreateInstaller(
ci::PkgMgrPtr pkgmgr, int idx) {
std::unique_ptr<ci::AppInstaller> installer;
- wgt::WgtAppQueryInterface* wgt_aqi = new wgt::WgtAppQueryInterface();
+ std::shared_ptr<wgt::WgtAppQueryInterface> wgt_aqi(
+ new wgt::WgtAppQueryInterface());
pkgmgr->AddAppQueryInterface(idx, wgt_aqi);
installer.reset(new hybrid::HybridInstaller(pkgmgr));
std::unique_ptr<ci::AppInstaller> WgtInstallerFactory::CreateInstaller(
ci::PkgMgrPtr pkgmgr, int idx) {
std::unique_ptr<ci::AppInstaller> installer;
- WgtAppQueryInterface* wgt_aqi = new WgtAppQueryInterface();
+ std::shared_ptr<WgtAppQueryInterface> wgt_aqi(new WgtAppQueryInterface());
pkgmgr->AddAppQueryInterface(idx, wgt_aqi);
installer.reset(new wgt::WgtInstaller(pkgmgr));
int main(int argc, char** argv) {
ci::PkgmgrInstaller pkgmgr_installer;
- wgt::WgtAppQueryInterface query_interface;
+ std::shared_ptr<wgt::WgtAppQueryInterface> query_interface(
+ new wgt::WgtAppQueryInterface());
try {
auto pkgmgr = ci::PkgMgrInterface::Create(argc, argv, &pkgmgr_installer,
- &query_interface);
+ query_interface);
std::unique_ptr<ci::InstallerFactory> installer_factory;
if (!pkgmgr) {
LOG(ERROR) << "Options of pkgmgr installer cannot be parsed";
#endif
// This is workaround for hybrid apps as they requires much different flow
// but installer does not branch at all in current design
- if (query_interface.IsHybridApplication(
+ if (query_interface->IsHybridApplication(
pkgmgr->GetRequestInfo(), pkgmgr->GetUid())) {
LOG(INFO) << "Hybrid package detected";
ci::InstallerRunner runner(
}
ci::PkgmgrInstaller pkgmgr_installer;
- wgt::WgtAppQueryInterface query_interface;
+ std::shared_ptr<wgt::WgtAppQueryInterface> query_interface(
+ new wgt::WgtAppQueryInterface());
auto pkgmgr = ci::PkgMgrInterface::Create(backend_argc, argv,
- &pkgmgr_installer, &query_interface);
+ &pkgmgr_installer, query_interface);
if (!pkgmgr) {
LOG(ERROR) << "Options of pkgmgr installer cannot be parsed";
return EINVAL;