Bug 782905 - [b2g-bluetooth] Calling setEnabled(false) twice in a very short period may crash, r=qdot

This commit is contained in:
Eric Chou 2012-08-16 10:47:39 +08:00
parent 5c56390bd9
commit b2f1558be8

View File

@ -40,9 +40,11 @@ public:
MOZ_ASSERT(NS_IsMainThread());
if (!mEnabled || gInShutdown) {
nsCOMPtr<nsIThread> t;
gBluetoothService->mBluetoothCommandThread.swap(t);
t->Shutdown();
if (gBluetoothService->mBluetoothCommandThread) {
nsCOMPtr<nsIThread> t;
gBluetoothService->mBluetoothCommandThread.swap(t);
t->Shutdown();
}
}
if (gInShutdown) {