diff --git a/rpcs3/Emu/Cell/lv2/sys_config.h b/rpcs3/Emu/Cell/lv2/sys_config.h index 9b1a2dc1e3..fd0e1210b5 100644 --- a/rpcs3/Emu/Cell/lv2/sys_config.h +++ b/rpcs3/Emu/Cell/lv2/sys_config.h @@ -195,11 +195,9 @@ public: template static std::shared_ptr create(Args&&... args) { - auto cfg = std::make_shared(std::forward(args)...); - - if (const u32 idm_id = idm::import_existing(cfg)) + if (auto cfg = idm::make_ptr(std::forward(args)...)) { - cfg->idm_id = idm_id; + cfg->idm_id = idm::last_id(); return cfg; } return nullptr; @@ -253,12 +251,10 @@ public: template static std::shared_ptr create(Args&&... args) { - auto service = std::make_shared(std::forward(args)...); - - if (const u32 idm_id = idm::import_existing(service)) + if (auto service = idm::make_ptr(std::forward(args)...)) { service->wkptr = service; - service->idm_id = idm_id; + service->idm_id = idm::last_id(); return service; } @@ -320,12 +316,10 @@ public: template static std::shared_ptr create(Args&&... args) { - auto listener = std::make_shared(std::forward(args)...); - - if (const u32 idm_id = idm::import_existing(listener)) + if (auto listener = idm::make_ptr(std::forward(args)...)) { listener->wkptr = listener; - listener->idm_id = idm_id; + listener->idm_id = idm::last_id(); return listener; }