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 ec586e5874
commit 95076b885d

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) {