mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Get rid of GetUsbPointer for emulated Bluetooth
It held a raw pointer to a IOS::HLE::Device::BluetoothEmu that is not guaranteed to exist (and of course, nothing checked that it wasn't nullptr), but what is more, it's totally unnecessary because we have IOS::HLE::GetDeviceByName(). Since we cannot always inform the host that Wii remotes are disconnected from ES, that is now done in BluetoothEmu's destructor.
This commit is contained in:
@ -143,7 +143,10 @@ void Host_ConnectWiimote(int wm_idx, bool connect)
|
||||
{
|
||||
Core::QueueHostJob([=] {
|
||||
bool was_unpaused = Core::PauseAndLock(true);
|
||||
IOS::HLE::GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
|
||||
const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
|
||||
IOS::HLE::GetDeviceByName("/dev/usb/oh1/57e/305"));
|
||||
if (bt)
|
||||
bt->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
|
||||
Host_UpdateMainFrame();
|
||||
Core::PauseAndLock(false, was_unpaused);
|
||||
});
|
||||
|
Reference in New Issue
Block a user