Bug 937572 - debug build MOZ_ASSERT fails in BluetoothOppManager::Disconnect(), r=echou

This commit is contained in:
Ben Tian 2013-11-15 09:42:53 +08:00
parent 1fde7c7c7a
commit e7995022be

View File

@ -281,7 +281,19 @@ BluetoothOppManager::HandleShutdown()
{
MOZ_ASSERT(NS_IsMainThread());
sInShutdown = true;
Disconnect(nullptr);
if (mSocket) {
mSocket->Disconnect();
mSocket = nullptr;
}
if (mRfcommSocket) {
mRfcommSocket->Disconnect();
mRfcommSocket = nullptr;
}
if (mL2capSocket) {
mL2capSocket->Disconnect();
mL2capSocket = nullptr;
}
sBluetoothOppManager = nullptr;
}
@ -450,8 +462,10 @@ BluetoothOppManager::StopSendingFile()
if (mIsServer) {
mAbortFlag = true;
} else if (mSocket) {
mSocket->Disconnect();
} else {
Disconnect(nullptr);
BT_WARNING("%s: No ongoing file transfer to stop", __FUNCTION__);
}
return true;
@ -514,7 +528,9 @@ BluetoothOppManager::AfterOppConnected()
// If we fail to get a mount lock, abort this transaction
// Directly sending disconnect-request is better than abort-request
BT_WARNING("BluetoothOPPManager couldn't get a mount lock!");
Disconnect(nullptr);
MOZ_ASSERT(mSocket);
mSocket->Disconnect();
}
}