From: Wootak Date: Thu, 28 May 2020 01:03:34 +0000 (+0900) Subject: [Bluetooth][Non-ACR] Invalid increased count issue (#1614) X-Git-Tag: accepted/tizen/5.5/unified/20200601.002414~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=867ff602c0f4421ce3e9d88f64cc89530bbb913e;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Bluetooth][Non-ACR] Invalid increased count issue (#1614) Signed-off-by: Wootak Jung --- diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs index 8b57289..6d772d9 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs @@ -38,7 +38,6 @@ namespace Tizen.Network.Bluetooth private Interop.Bluetooth.GattConnectionStateChangedCallBack _gattConnectionStateChangedCallback; private int _serviceListCount = 0; - private IList _list = new List(); private bool _scanStarted; internal static BluetoothLeImplAdapter Instance @@ -394,17 +393,18 @@ namespace Tizen.Network.Bluetooth Log.Info(Globals.LogTag, "Count of ServiceDataList: " + _serviceListCount); + IList list = new List(); int sizePointerToABC = Marshal.SizeOf(new BluetoothLeServiceDataStruct()); for (int i = 0; i < _serviceListCount; i++) { var svc = (BluetoothLeServiceDataStruct)Marshal.PtrToStructure(new IntPtr(serviceListArray.ToInt32() + (i * sizePointerToABC)), typeof(BluetoothLeServiceDataStruct)); - _list.Add(BluetoothUtils.ConvertStructToLeServiceData(svc)); + list.Add(BluetoothUtils.ConvertStructToLeServiceData(svc)); } Interop.Bluetooth.FreeServiceDataList(serviceListArray, _serviceListCount); Marshal.FreeHGlobal(scanDataStruct.AdvData); Marshal.FreeHGlobal(scanDataStruct.ScanData); - return _list; + return list; } internal int GetScanResultAppearance(BluetoothLeScanData scanData, BluetoothLePacketType packetType)