From 867ff602c0f4421ce3e9d88f64cc89530bbb913e Mon Sep 17 00:00:00 2001 From: Wootak Date: Thu, 28 May 2020 10:03:34 +0900 Subject: [PATCH] [Bluetooth][Non-ACR] Invalid increased count issue (#1614) Signed-off-by: Wootak Jung --- .../Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.7.4