mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Add a clang plugin check that flags GC::Cell subclasses (and their base classes within the Cell hierarchy) that have destructors with non-trivial bodies. Such logic should use Cell::finalize() instead. Add GC_ALLOW_CELL_DESTRUCTOR annotation macro for opting out in exceptional cases (currently only JS::Object). This prevents us from accidentally adding code in destructors that runs after something we're pointing to may have been destroyed. (This could become a problem when the garbage collector sweeps objects in an unfortunate order.) This new check uncovered a handful of bugs which are then also fixed in this commit. :^)