зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1447871 P3 Make nsIGlobalObject::ForEachEventTargetObject() protect against side effects that might delete other DETH objects. r=asuth
This commit is contained in:
Родитель
dcad56bf27
Коммит
48efa4db3f
|
@ -157,6 +157,11 @@ nsIGlobalObject::ForEachEventTargetObject(const std::function<void(DOMEventTarge
|
|||
// Iterate the target list and call the function on each one.
|
||||
bool done = false;
|
||||
for (auto target : targetList) {
|
||||
// Check to see if a previous iteration's callback triggered the removal
|
||||
// of this target as a side-effect. If it did, then just ignore it.
|
||||
if (!mEventTargetObjects.Contains(target)) {
|
||||
continue;
|
||||
}
|
||||
aFunc(target, &done);
|
||||
if (done) {
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче