mc.mitm: return shared_ptr from LocateHandler function instead of raw pointer

This commit is contained in:
ndeadly 2022-03-30 16:16:08 +11:00
parent c2402888a6
commit 18c7453530
2 changed files with 3 additions and 3 deletions

View file

@ -299,12 +299,12 @@ namespace ams::controller {
}
}
SwitchController *LocateHandler(const bluetooth::Address *address) {
std::shared_ptr<SwitchController> LocateHandler(const bluetooth::Address *address) {
std::scoped_lock lk(g_controller_lock);
for (auto it = g_controllers.begin(); it < g_controllers.end(); ++it) {
if (bdcmp(&(*it)->Address(), address)) {
return (*it).get();
return (*it);
}
}

View file

@ -85,6 +85,6 @@ namespace ams::controller {
void AttachHandler(const bluetooth::Address *address);
void RemoveHandler(const bluetooth::Address *address);
SwitchController *LocateHandler(const bluetooth::Address *address);
std::shared_ptr<SwitchController> LocateHandler(const bluetooth::Address *address);
}