Bug 1907806: Clear mPending out before closing channels. r=ng

Differential Revision: https://phabricator.services.mozilla.com/D216736
This commit is contained in:
Byron Campen [:bwc] 2024-07-25 18:33:29 +00:00
parent 533bc1ce3e
commit fffcd94c55

View File

@ -3018,13 +3018,13 @@ void DataChannelConnection::CloseAll() {
}
// Clean up any pending opens for channels
for (const auto& channel : mPending) {
std::set<RefPtr<DataChannel>> temp(std::move(mPending));
for (const auto& channel : temp) {
DC_DEBUG(("closing pending channel %p, stream %u", channel.get(),
channel->mStream));
MutexAutoUnlock lock(mLock);
channel->Close(); // also releases the ref on each iteration
}
mPending.clear();
// It's more efficient to let the Resets queue in shutdown and then
// SendOutgoingStreamReset() here.
SendOutgoingStreamReset();