TTRACE(TTRACE_TAG_APP, "TPK_BACKEND");
ci::PkgmgrInstaller pkgmgr_installer;
- tpk::TpkAppQueryInterface interface;
+ std::shared_ptr<tpk::TpkAppQueryInterface> interface(
+ new tpk::TpkAppQueryInterface());
try {
ci::PkgMgrPtr pkgmgr = ci::PkgMgrInterface::Create(argc, argv,
&pkgmgr_installer,
- &interface);
+ interface);
if (!pkgmgr) {
LOG(ERROR) << "Failed to create pkgmgr interface";
return -1;
std::unique_ptr<ci::AppInstaller> TpkInstallerFactory::CreateInstaller(
ci::PkgMgrPtr pkgmgr, int idx) {
std::unique_ptr<ci::AppInstaller> installer;
- TpkAppQueryInterface* tpk_aqi = new TpkAppQueryInterface();
+ std::shared_ptr<TpkAppQueryInterface> tpk_aqi(new TpkAppQueryInterface());
pkgmgr->AddAppQueryInterface(idx, tpk_aqi);
installer.reset(new TpkInstaller(pkgmgr));
}
ci::PkgmgrInstaller pkgmgr_installer;
- tpk::TpkAppQueryInterface interface;
+ std::shared_ptr<tpk::TpkAppQueryInterface> interface(
+ new tpk::TpkAppQueryInterface());
ci::PkgMgrPtr pkgmgr = ci::PkgMgrInterface::Create(backend_argc, argv,
&pkgmgr_installer,
- &interface);
+ interface);
if (!pkgmgr) {
LOG(ERROR) << "Failed to create pkgmgr interface";
return -1;