зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1142364: Store instances of |Bluetooth*HALResultRunnable| in ref-counted pointers, r=shuang
Result runnables in Bluetooth's HAL backend ar now protected by ref-counted pointers. This prevent memory leaks if dispatching to the main thread fails.
This commit is contained in:
Родитель
00203bbd7a
Коммит
8a7c1130d3
|
@ -26,7 +26,7 @@ DispatchBluetoothA2dpHALResult(
|
|||
{
|
||||
MOZ_ASSERT(aRes);
|
||||
|
||||
nsRunnable* runnable;
|
||||
nsRefPtr<nsRunnable> runnable;
|
||||
|
||||
if (aStatus == STATUS_SUCCESS) {
|
||||
runnable = new BluetoothA2dpHALResultRunnable(aRes, aMethod);
|
||||
|
|
|
@ -26,7 +26,7 @@ DispatchBluetoothAvrcpHALResult(
|
|||
{
|
||||
MOZ_ASSERT(aRes);
|
||||
|
||||
nsRunnable* runnable;
|
||||
nsRefPtr<nsRunnable> runnable;
|
||||
|
||||
if (aStatus == STATUS_SUCCESS) {
|
||||
runnable = new BluetoothAvrcpHALResultRunnable(aRes, aMethod);
|
||||
|
|
|
@ -79,7 +79,7 @@ DispatchBluetoothHALResult(BluetoothResultHandler* aRes,
|
|||
{
|
||||
MOZ_ASSERT(aRes);
|
||||
|
||||
nsRunnable* runnable;
|
||||
nsRefPtr<nsRunnable> runnable;
|
||||
|
||||
if (aStatus == STATUS_SUCCESS) {
|
||||
runnable = new BluetoothHALResultRunnable(aRes, aMethod);
|
||||
|
|
|
@ -26,7 +26,7 @@ DispatchBluetoothHandsfreeHALResult(
|
|||
{
|
||||
MOZ_ASSERT(aRes);
|
||||
|
||||
nsRunnable* runnable;
|
||||
nsRefPtr<nsRunnable> runnable;
|
||||
|
||||
if (aStatus == STATUS_SUCCESS) {
|
||||
runnable = new BluetoothHandsfreeHALResultRunnable(aRes, aMethod);
|
||||
|
|
|
@ -37,7 +37,7 @@ DispatchBluetoothSocketHALResult(
|
|||
{
|
||||
MOZ_ASSERT(aRes);
|
||||
|
||||
nsRunnable* runnable;
|
||||
nsRefPtr<nsRunnable> runnable;
|
||||
|
||||
if (aStatus == STATUS_SUCCESS) {
|
||||
runnable = new BluetoothSocketHALIntResultRunnable(aRes, aMethod, aArg);
|
||||
|
@ -60,7 +60,7 @@ DispatchBluetoothSocketHALResult(
|
|||
{
|
||||
MOZ_ASSERT(aRes);
|
||||
|
||||
nsRunnable* runnable;
|
||||
nsRefPtr<nsRunnable> runnable;
|
||||
|
||||
if (aStatus == STATUS_SUCCESS) {
|
||||
runnable = new BluetoothSocketHALIntStringIntResultRunnable(
|
||||
|
|
Загрузка…
Ссылка в новой задаче