investigating xbox failure on restart (WIP)

This commit is contained in:
SamGondelman 2016-06-07 11:42:58 -07:00
parent 30526374bc
commit dd97f16728

View file

@ -77,7 +77,7 @@ void UserInputMapper::registerDevice(InputDevice::Pointer device) {
}
const auto& deviceID = device->_deviceID;
recordDeviceOfType(device->getName());
//recordDeviceOfType(device->getName());
qCDebug(controllers) << "Registered input device <" << device->getName() << "> deviceID = " << deviceID;
@ -134,6 +134,15 @@ void UserInputMapper::removeDevice(int deviceID) {
_mappingsByDevice.erase(mappingsEntry);
}
for (const auto& inputMapping : device->getAvailableInputs()) {
const auto& input = inputMapping.first;
auto endpoint = _endpointsByInput.find(input);
if (endpoint != _endpointsByInput.end()) {
_inputsByEndpoint.erase((*endpoint).second);
_endpointsByInput.erase(input);
}
}
_registeredDevices.erase(proxyEntry);
emit hardwareChanged();