1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:47:35 +00:00

LibJS: Visit WeakMap's values as long as their keys were not collected

While the WeakMap only holds a weak reference to its keys, their
accompanying values should be kept alive as long as they're accessible.
This commit is contained in:
Idan Horowitz 2021-09-11 19:19:40 +03:00 committed by Andreas Kling
parent 073a1dec16
commit b92871f7ef
2 changed files with 8 additions and 0 deletions

View file

@ -31,6 +31,7 @@ public:
private:
virtual void did_become_zombie() override { deregister(); }
void visit_edges(Visitor&) override;
HashMap<Cell*, Value> m_values; // This stores Cell pointers instead of Object pointers to aide with sweeping
};