Bug 756389 - B2G Bluetooth: unexpected crash in DBusThread::StopEventLoop; r=cjones

This commit is contained in:
Kyle Machulis 2012-05-23 18:21:42 -07:00
Родитель 421f8ec45d
Коммит 6f1c8ccf33
2 изменённых файлов: 24 добавлений и 8 удалений

Просмотреть файл

@ -211,14 +211,23 @@ SystemWorkerManager::Init()
}
nsresult rv = InitRIL(cx);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv)) {
NS_WARNING("Failed to initialize RIL/Telephony!");
return rv;
}
rv = InitWifi(cx);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv)) {
NS_WARNING("Failed to initialize WiFi Networking!");
return rv;
}
#ifdef MOZ_B2G_BT
rv = InitBluetooth(cx);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv)) {
NS_WARNING("Failed to initialize Bluetooth!");
return rv;
}
#endif
nsCOMPtr<nsIObserverService> obs =
@ -229,7 +238,10 @@ SystemWorkerManager::Init()
}
rv = obs->AddObserver(this, WORKERS_SHUTDOWN_TOPIC, false);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv)) {
NS_WARNING("Failed to initialize worker shutdown event!");
return rv;
}
return NS_OK;
}

Просмотреть файл

@ -531,8 +531,10 @@ DBusThread::IsEventLoopRunning()
static void
ConnectDBus(Monitor* aMonitor, bool* aSuccess)
{
MOZ_ASSERT(!sDBusThread);
if(sDBusThread) {
NS_WARNING("Trying to start DBus Thread that is already currently running, skipping.");
return;
}
sDBusThread = new DBusThread();
*aSuccess = true;
if(!sDBusThread->StartEventLoop())
@ -548,8 +550,10 @@ ConnectDBus(Monitor* aMonitor, bool* aSuccess)
static void
DisconnectDBus(Monitor* aMonitor, bool* aSuccess)
{
MOZ_ASSERT(sDBusThread);
if(!sDBusThread) {
NS_WARNING("Trying to shutdown DBus Thread that is not currently running, skipping.");
return;
}
*aSuccess = true;
sDBusThread->StopEventLoop();
sDBusThread = NULL;