Commit 315bcf81 authored by Jon Coppeard's avatar Jon Coppeard
Browse files

Bug 1755257 - Clear the table of cross zone registry counts when clearing the...

Bug 1755257 - Clear the table of cross zone registry counts when clearing the finalization registry record map r=sfink

crossZoneCount contains the counts of cross-zone finalization registry records
in recordMap. Therefore when we clear recordMap, we should also clear the
crossZoneCount map.

This happens on shutdown and can cause the assertion to trigger. It does not
cause any actual problem.

Differential Revision: https://phabricator.services.mozilla.com/D138671
parent 2399972c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -141,7 +141,10 @@ void FinalizationRegistryZone::decCrossZoneCount(Zone* otherZone) {
  }
}

void FinalizationRegistryZone::clearRecords() { recordMap.clear(); }
void FinalizationRegistryZone::clearRecords() {
  recordMap.clear();
  crossZoneCount.clear();
}

static FinalizationRecordObject* UnwrapFinalizationRecord(JSObject* obj) {
  obj = UncheckedUnwrapWithoutExpose(obj);
+1 −0
Original line number Diff line number Diff line
new FinalizationRegistry(a => 1).register(newGlobal({newCompartment: true}))