HomePhorge

TempFSFile: Keep the WeakMap alive

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

TempFSFile: Keep the WeakMap alive

If you store a WeakMap in the object, containing only circular
references in the values, then nothing is keeping the WeakMap alive and
it can be deleted along with its parent TempFSFile by the garbage
collector.

A WeakMap contains normal references to its values, so those normal
references can be marked by the GC like any other references.

Instead, store the WeakMap as a static property.

Bug: T332461
Bug: T332397
Change-Id: Idbaa1019c2bac3d1dd9b001753c2f4c0aaf66e98
(cherry picked from commit 7775a3f7b7df0d79097659941847726bc4c6a627)

Details

Provenance
Tim Starling <tstarling@wikimedia.org>Authored on Mar 18 2023, 3:18 AM
Jforrester <jforrester@wikimedia.org>Committed on Mar 20 2023, 12:48 PM

Event Timeline

Jforrester <jforrester@wikimedia.org> committed rMWb8b7c591d694: TempFSFile: Keep the WeakMap alive (authored by Tim Starling <tstarling@wikimedia.org>).Mar 20 2023, 12:48 PM

Commit No Longer Exists

This commit no longer exists in the repository.