From fcc15cdd858c02d05a7d792f9c2571979519b113 Mon Sep 17 00:00:00 2001 From: Jamin Liu Date: Tue, 6 May 2014 11:45:51 +0800 Subject: [PATCH] Bug 1003657 - Don't keep reference in GetDefaultAdapterPathInternal() to avoid memory leak. r=echou, f=shuang --- dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp index 872a2d1f819..b93dc125af5 100644 --- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp +++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp @@ -772,8 +772,6 @@ BluetoothServiceBluedroid::GetDefaultAdapterPathInternal( { MOZ_ASSERT(NS_IsMainThread()); - nsRefPtr runnable(aRunnable); - BluetoothValue v = InfallibleTArray(); BT_APPEND_NAMED_VALUE(v.get_ArrayOfBluetoothNamedValue(), @@ -791,10 +789,7 @@ BluetoothServiceBluedroid::GetDefaultAdapterPathInternal( BT_APPEND_NAMED_VALUE(v.get_ArrayOfBluetoothNamedValue(), "Devices", sAdapterBondedAddressArray); - nsAutoString replyError; - DispatchBluetoothReply(runnable.get(), v, replyError); - - unused << runnable.forget(); // picked up in DispatchBluetoothReply + DispatchBluetoothReply(aRunnable, v, EmptyString()); return NS_OK; }