diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-01-04 12:23:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-04 11:23:43 +0000 |
commit | 5b6c75e358512e16e88a7d1edcb3e3ed45dadcdc (patch) | |
tree | c45a28d897045983775e82ec7f9d1a81aca7ff3a /components/script/dom/bindings/codegen | |
parent | b2eda71952f32c0e486c72ed881f472e59ad37c0 (diff) | |
download | servo-5b6c75e358512e16e88a7d1edcb3e3ed45dadcdc.tar.gz servo-5b6c75e358512e16e88a7d1edcb3e3ed45dadcdc.zip |
script: Move `TimerListener` creation to `OneShotTimers` (#34825)
Before each `OneShotTimers` would have a `TimerListener` for its
lifetime, holding the timer `TaskSource`. The issue with this is that
the `TaskSource` for dedicated workers keeps the main thread object
alive, so as long as the `OneShotTimers` alive (until the worker thread
exists), the main thread object would never be garbage collected.
This change makes the creation of the listener on-demand, avoiding the
long-lived handle to the main thread object and slightly simplifying
`OneShotTimers` at the expense of some more operations when scheduling a
timer.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/script/dom/bindings/codegen')
0 files changed, 0 insertions, 0 deletions