LibGC+LibWeb: Add and use GC::weak_callback()

This commit is contained in:
Jelle Raaijmakers
2026-02-25 10:00:33 +01:00
committed by Tim Flynn
parent 2b78b84979
commit f9e837a832
Notes: github-actions[bot] 2026-02-26 13:04:58 +00:00
4 changed files with 47 additions and 61 deletions

View File

@@ -33,10 +33,9 @@ GC_DEFINE_ALLOCATOR(HTMLTextAreaElement);
HTMLTextAreaElement::HTMLTextAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
, m_input_event_timer(Core::Timer::create_single_shot(0, [weak_this = GC::Weak { *this }]() {
if (weak_this)
weak_this->queue_firing_input_event();
}))
, m_input_event_timer(Core::Timer::create_single_shot(0, GC::weak_callback(*this, [](auto& self) {
self.queue_firing_input_event();
})))
{
}