fix: segfault in SerialChooserController (#25969)
* fix: segfault in SerialChooserController * Remove temporary testing
This commit is contained in:
parent
6a0221297e
commit
87d3f3584c
2 changed files with 4 additions and 12 deletions
|
@ -77,11 +77,13 @@ SerialChooserController::SerialChooserController(
|
|||
DCHECK(chooser_context_);
|
||||
chooser_context_->GetPortManager()->GetDevices(base::BindOnce(
|
||||
&SerialChooserController::OnGetDevices, weak_factory_.GetWeakPtr()));
|
||||
observer_.Add(chooser_context_.get());
|
||||
}
|
||||
|
||||
SerialChooserController::~SerialChooserController() {
|
||||
RunCallback(/*port=*/nullptr);
|
||||
if (chooser_context_) {
|
||||
chooser_context_->RemovePortObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
api::Session* SerialChooserController::GetSession() {
|
||||
|
@ -114,10 +116,6 @@ void SerialChooserController::OnPortRemoved(
|
|||
}
|
||||
}
|
||||
|
||||
void SerialChooserController::OnPortManagerConnectionError() {
|
||||
observer_.RemoveAll();
|
||||
}
|
||||
|
||||
void SerialChooserController::OnDeviceChosen(const std::string& port_id) {
|
||||
if (port_id.empty()) {
|
||||
RunCallback(/*port=*/nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue