mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Fix __FrameHandler3::CxxCallCatchBlock crashes at Nearby Connections layer
PiperOrigin-RevId: 542085514
This commit is contained in:
committed by
Copybara-Service
parent
1973b09849
commit
7eca4d74c6
@@ -149,6 +149,9 @@ void BluetoothClassicMedium::OnScanModeChanged(
|
||||
<< ": OnScanModeChanged exception: " << ex.code() << ": "
|
||||
<< winrt::to_string(ex.message());
|
||||
return;
|
||||
} catch (...) {
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": Unknown exception.";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,6 +223,8 @@ void BluetoothClassicMedium::InitializeDeviceWatcher() {
|
||||
NEARBY_LOGS(ERROR) << __func__
|
||||
<< ": InitializeDeviceWatcher exception: " << ex.code()
|
||||
<< ": " << winrt::to_string(ex.message());
|
||||
} catch (...) {
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": Unknown exception.";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,6 +348,9 @@ std::unique_ptr<api::BluetoothSocket> BluetoothClassicMedium::ConnectToService(
|
||||
<< ex.code()
|
||||
<< ", error message: " << winrt::to_string(ex.message());
|
||||
return nullptr;
|
||||
} catch (...) {
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": Unknown exception.";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,6 +381,8 @@ std::unique_ptr<api::BluetoothPairing> BluetoothClassicMedium::CreatePairing(
|
||||
<< ": Failed to create pairing. WinRT exception: "
|
||||
<< error.code() << ": "
|
||||
<< winrt::to_string(error.message());
|
||||
} catch (...) {
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": Unknown exception.";
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -806,6 +816,18 @@ bool BluetoothClassicMedium::StartAdvertising(bool radio_discoverable) {
|
||||
rfcomm_provider_ = nullptr;
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (...) {
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": Unknown exception.";
|
||||
if (server_socket_ != nullptr) {
|
||||
server_socket_->Close();
|
||||
server_socket_ = nullptr;
|
||||
}
|
||||
|
||||
if (rfcomm_provider_ != nullptr) {
|
||||
rfcomm_provider_ = nullptr;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -836,6 +858,9 @@ bool BluetoothClassicMedium::StopAdvertising() {
|
||||
<< ": StopAdvertising exception: " << ex.code() << ": "
|
||||
<< winrt::to_string(ex.message());
|
||||
return false;
|
||||
} catch (...) {
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": Unknown exception.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user