From a1a442c8ebdd706436684b5d5ab21bb0fe361707 Mon Sep 17 00:00:00 2001 From: Guogang Li Date: Wed, 27 Sep 2023 15:46:15 -0700 Subject: [PATCH] Try to fix a crash when checking Bluetooth state PiperOrigin-RevId: 568982667 --- .../platform/implementation/windows/bluetooth_adapter.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/platform/implementation/windows/bluetooth_adapter.h b/internal/platform/implementation/windows/bluetooth_adapter.h index dadb2f9a..34923e48 100644 --- a/internal/platform/implementation/windows/bluetooth_adapter.h +++ b/internal/platform/implementation/windows/bluetooth_adapter.h @@ -40,7 +40,7 @@ using WindowsBluetoothAdapter = // Represents a radio device on the system. // https://docs.microsoft.com/en-us/uwp/api/windows.devices.radios.radio?view=winrt-20348 -using winrt::Windows::Devices::Radios::IRadio; +using winrt::Windows::Devices::Radios::Radio; // Enumeration that describes possible radio states. // https://docs.microsoft.com/en-us/uwp/api/windows.devices.radios.radiostate?view=winrt-20348 @@ -115,10 +115,10 @@ class BluetoothAdapter : public api::BluetoothAdapter { void StoreRadioNames(absl::string_view original_radio_name, absl::string_view nearby_radio_name); - WindowsBluetoothAdapter windows_bluetooth_adapter_; + WindowsBluetoothAdapter windows_bluetooth_adapter_ = nullptr; std::string registry_bluetooth_adapter_name_; - IRadio windows_bluetooth_radio_; + Radio windows_bluetooth_radio_ = nullptr; std::optional GetGenericBluetoothAdapterInstanceID() const; void find_and_replace(char *source, const char *strFind, const char *strReplace) const;