Bug 1248794 - Clean up observer on WindowsGamepadService shutdown; r=ted r=smaug sec-approval=abillings

This commit is contained in:
Kyle Machulis 2016-02-16 17:31:12 -08:00
parent 9c2a1383ce
commit f134028713

View File

@ -882,13 +882,19 @@ WindowsGamepadService::Cleanup()
mXInputPollTimer->Cancel();
}
mGamepads.Clear();
if (mObserver) {
mObserver->Stop();
mObserver = nullptr;
}
}
void
WindowsGamepadService::DevicesChanged(DeviceChangeType type)
{
if (type == DeviceChangeNotification) {
mObserver->SetDeviceChangeTimer();
if (mObserver) {
mObserver->SetDeviceChangeTimer();
}
} else if (type == DeviceChangeStable) {
ScanForDevices();
}