Bug 1507180 - Make copy of list before iterating over it r=dom-workers-and-storage-reviewers,sg
authorYaron Tausky <ytausky@mozilla.com>
Wed, 04 Dec 2019 10:47:30 +0000
changeset 506470 cdf525897bffc445c4c860225ecb42eda5925a86
parent 506469 99abe5757ee597f98475e89bb1bd730708ecc67f
child 506471 a336ad33f55374536c61865e1a04ae022e0ef8b2
push id36904
push userncsoregi@mozilla.com
push dateWed, 11 Dec 2019 17:42:45 +0000
treeherdermozilla-central@b823b005f00e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdom-workers-and-storage-reviewers, sg
bugs1507180
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/cache/StreamControl.cpp
--- a/dom/cache/StreamControl.cpp
+++ b/dom/cache/StreamControl.cpp
@@ -52,17 +52,18 @@ void StreamControl::CloseReadStreams(con
   }
 
   MOZ_DIAGNOSTIC_ASSERT(closedCount > 0);
 }
 
 void StreamControl::CloseAllReadStreams() {
   AssertOwningThread();
 
-  ReadStreamList::ForwardIterator iter(mReadStreamList);
+  auto readStreamList = mReadStreamList;
+  ReadStreamList::ForwardIterator iter(readStreamList);
   while (iter.HasMore()) {
     iter.GetNext()->CloseStream();
   }
 }
 
 void StreamControl::CloseAllReadStreamsWithoutReporting() {
   AssertOwningThread();