Bug 1152095 - Check mResultHandlerQ is empty before dispatching DispatchError. r=tzimmermann

This commit is contained in:
Shawn Huang 2015-04-09 04:20:00 -04:00
parent f2b2d16cce
commit 362034f21c

View File

@ -1898,7 +1898,8 @@ BluetoothDaemonInterface::OnConnectError(enum Channel aChannel)
// Stop daemon and close listen socket
unused << NS_WARN_IF(property_set("ctl.stop", "bluetoothd"));
mListenSocket->Close();
case LISTEN_SOCKET: {
case LISTEN_SOCKET:
if (!mResultHandlerQ.IsEmpty()) {
// Signal error to caller
nsRefPtr<BluetoothResultHandler> res = mResultHandlerQ.ElementAt(0);
mResultHandlerQ.RemoveElementAt(0);