mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
We have a common pattern of creating a `WeakPtr<T>` from a reference and passing that into a lambda, to then take the strong ref when the lambda is executed. Add `weak_callback(Weakable, lambda)` that returns a lambda that only invokes the callback if a strong ref exists, and passes it as the first argument.