mirror of
https://github.com/ndeadly/MissionControl
synced 2024-11-23 04:43:10 +00:00
mc.mitm: return shared_ptr from LocateHandler function instead of raw pointer
This commit is contained in:
parent
c2402888a6
commit
18c7453530
2 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue