mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
cl/356907843 Prevent closing socket twice.
This commit is contained in:
@@ -49,9 +49,8 @@ InputStream& WebRtcSocket::GetInputStream() { return pipe_.GetInputStream(); }
|
||||
OutputStream& WebRtcSocket::GetOutputStream() { return output_stream_; }
|
||||
|
||||
void WebRtcSocket::Close() {
|
||||
if (IsClosed()) return;
|
||||
if (closed_.Set(true)) return;
|
||||
|
||||
closed_.Set(true);
|
||||
pipe_.GetInputStream().Close();
|
||||
pipe_.GetOutputStream().Close();
|
||||
data_channel_->Close();
|
||||
|
||||
Reference in New Issue
Block a user