Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 662be34d authored by Hansong Zhang's avatar Hansong Zhang
Browse files

DynamicChannelImpl::Close check if it's closed first

Coule be the case where it's closed, but the client called Close()
before that.

Bug: 167263142
Test: cert/run --host
Tag: #gd-refactor
Change-Id: I5c74081d38e02ece143d7a7ee46606bed83a5f2d
parent 648dd98e
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -55,6 +55,10 @@ void DynamicChannelImpl::RegisterOnCloseCallback(DynamicChannel::OnCloseCallback
}
}


void DynamicChannelImpl::Close() {
void DynamicChannelImpl::Close() {
  if (link_ == nullptr) {
    LOG_ERROR("Channel is already closed");
    return;
  }
  link_->SendDisconnectionRequest(cid_, remote_cid_);
  link_->SendDisconnectionRequest(cid_, remote_cid_);
}
}