Bug 838080 - Cannot receive all events after a series of actions, r=echou

This commit is contained in:
Gina Yeh 2013-02-06 09:35:29 +08:00
parent bec42bf2d7
commit 7f762c6b66

View File

@ -358,13 +358,22 @@ BluetoothService::UnregisterBluetoothSignalHandler(
}
}
PLDHashOperator
RemoveAllSignalHandlers(const nsAString& aKey,
nsAutoPtr<BluetoothSignalObserverList>& aData,
void* aUserArg)
{
aData->RemoveObserver(static_cast<BluetoothSignalObserver*>(aUserArg));
return aData->Length() ? PL_DHASH_NEXT : PL_DHASH_REMOVE;
}
void
BluetoothService::UnregisterAllSignalHandlers(BluetoothSignalObserver* aHandler)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aHandler);
mBluetoothSignalObserverTable.Clear();
mBluetoothSignalObserverTable.Enumerate(RemoveAllSignalHandlers, aHandler);
}
void