Commit 249401cc authored by Alex Thayer's avatar Alex Thayer
Browse files

Bug 1651941 - Free unreferenced child StartupCache entries on send r=froydnj

This is similar to the first patch in the stack, but instead of freeing the
entries on write, we free them when we send them to the parent to be written.

Differential Revision: https://phabricator.services.mozilla.com/D83401
parent a538eb78
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -46,6 +46,13 @@ void StartupCacheChild::SendEntriesAndFinalize(StartupCache::Table& entries) {
  }

  Send__delete__(this, dataArray);

  for (auto iter = entries.iter(); !iter.done(); iter.next()) {
    auto& value = iter.get().value();
    if (!value.mFlags.contains(StartupCacheEntryFlags::DoNotFree)) {
      value.mData = nullptr;
    }
  }
}

void StartupCacheChild::ActorDestroy(ActorDestroyReason aWhy) {