Bug 742376 - DisableDevice is being called with types that are not known device sensors. r=smaug

This commit is contained in:
Doug Turner 2012-04-04 09:26:12 -07:00
parent ffe6eab00e
commit c7eec92703

View File

@ -398,6 +398,7 @@ nsEventListenerManager::RemoveEventListener(nsIDOMEventListener *aListener,
PRUint32 count = mListeners.Length();
PRUint32 typeCount = 0;
bool deviceType = IsDeviceType(aType);
for (PRUint32 i = 0; i < count; ++i) {
ls = &mListeners.ElementAt(i);
@ -411,7 +412,7 @@ nsEventListenerManager::RemoveEventListener(nsIDOMEventListener *aListener,
mNoListenerForEvent = NS_EVENT_TYPE_NULL;
mNoListenerForEventAtom = nsnull;
if (!IsDeviceType(aType)) {
if (deviceType) {
return;
}
--typeCount;
@ -419,7 +420,7 @@ nsEventListenerManager::RemoveEventListener(nsIDOMEventListener *aListener,
}
}
if (typeCount == 0) {
if (deviceType && typeCount == 0) {
DisableDevice(aType);
}
}