mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
avoid lambda use in shared_ptr deleters
This commit is contained in:
parent
f4ca2c02a7
commit
4f9838df3c
1 changed files with 2 additions and 6 deletions
|
@ -80,18 +80,14 @@ namespace ams::sf::hipc {
|
||||||
|
|
||||||
/* Create new object. */
|
/* Create new object. */
|
||||||
cmif::MitmDomainServiceObject *domain_ptr = static_cast<cmif::MitmDomainServiceObject *>(domain);
|
cmif::MitmDomainServiceObject *domain_ptr = static_cast<cmif::MitmDomainServiceObject *>(domain);
|
||||||
new_holder = cmif::ServiceObjectHolder(std::move(std::shared_ptr<cmif::MitmDomainServiceObject>(domain_ptr, [](cmif::MitmDomainServiceObject *obj) {
|
new_holder = cmif::ServiceObjectHolder(std::move(std::shared_ptr<cmif::MitmDomainServiceObject>(domain_ptr, cmif::ServerDomainManager::DestroyDomainServiceObject)));
|
||||||
cmif::ServerDomainManager::DestroyDomainServiceObject(static_cast<cmif::DomainServiceObject *>(obj));
|
|
||||||
})));
|
|
||||||
} else {
|
} else {
|
||||||
/* We're not a mitm session. Reserve a new object in the domain. */
|
/* We're not a mitm session. Reserve a new object in the domain. */
|
||||||
R_TRY(domain->ReserveIds(&object_id, 1));
|
R_TRY(domain->ReserveIds(&object_id, 1));
|
||||||
|
|
||||||
/* Create new object. */
|
/* Create new object. */
|
||||||
cmif::DomainServiceObject *domain_ptr = static_cast<cmif::DomainServiceObject *>(domain);
|
cmif::DomainServiceObject *domain_ptr = static_cast<cmif::DomainServiceObject *>(domain);
|
||||||
new_holder = cmif::ServiceObjectHolder(std::move(std::shared_ptr<cmif::DomainServiceObject>(domain_ptr, [](cmif::DomainServiceObject *obj) {
|
new_holder = cmif::ServiceObjectHolder(std::move(std::shared_ptr<cmif::DomainServiceObject>(domain_ptr, cmif::ServerDomainManager::DestroyDomainServiceObject)));
|
||||||
cmif::ServerDomainManager::DestroyDomainServiceObject(static_cast<cmif::DomainServiceObject *>(obj));
|
|
||||||
})));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AMS_ASSERT(object_id != cmif::InvalidDomainObjectId);
|
AMS_ASSERT(object_id != cmif::InvalidDomainObjectId);
|
||||||
|
|
Loading…
Reference in a new issue