mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-27 02:43:07 +00:00
Bug 1050494: Clear sBluetoothThread in BluetoothDBusService on shutdown to fix memory leak. r=shuang
This commit is contained in:
parent
92a362d3ac
commit
de0443c58f
@ -37,6 +37,7 @@
|
||||
#include "nsDataHashtable.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "mozilla/Hal.h"
|
||||
#include "mozilla/ipc/UnixSocket.h"
|
||||
@ -373,6 +374,7 @@ DispatchToBtThread(nsIRunnable* aRunnable)
|
||||
sBluetoothThread = new LazyIdleThread(BT_LAZY_THREAD_TIMEOUT_MS,
|
||||
NS_LITERAL_CSTRING("BluetoothDBusService"),
|
||||
LazyIdleThread::ManualShutdown);
|
||||
ClearOnShutdown(&sBluetoothThread);
|
||||
}
|
||||
return sBluetoothThread->Dispatch(aRunnable, NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "nsDataHashtable.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "mozilla/Hal.h"
|
||||
#include "mozilla/ipc/UnixSocket.h"
|
||||
@ -370,6 +371,7 @@ DispatchToBtThread(nsIRunnable* aRunnable)
|
||||
sBluetoothThread = new LazyIdleThread(BT_LAZY_THREAD_TIMEOUT_MS,
|
||||
NS_LITERAL_CSTRING("BluetoothDBusService"),
|
||||
LazyIdleThread::ManualShutdown);
|
||||
ClearOnShutdown(&sBluetoothThread);
|
||||
}
|
||||
return sBluetoothThread->Dispatch(aRunnable, NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user