Bug 1507180 - Make copy of list before iterating over it r=dom-workers-and-storage-reviewers,sg

Differential Revision: https://phabricator.services.mozilla.com/D55286

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Yaron Tausky 2019-12-04 10:47:30 +00:00
parent 3f2680cc2c
commit e1fcfedadb

View File

@ -57,7 +57,8 @@ void StreamControl::CloseReadStreams(const nsID& aId) {
void StreamControl::CloseAllReadStreams() {
AssertOwningThread();
ReadStreamList::ForwardIterator iter(mReadStreamList);
auto readStreamList = mReadStreamList;
ReadStreamList::ForwardIterator iter(readStreamList);
while (iter.HasMore()) {
iter.GetNext()->CloseStream();
}