mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibGC+LibWeb: Add and use GC::weak_callback()
This commit is contained in:
committed by
Tim Flynn
parent
2b78b84979
commit
f9e837a832
Notes:
github-actions[bot]
2026-02-26 13:04:58 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/f9e837a8321 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8158 Reviewed-by: https://github.com/Zaggy1024 Reviewed-by: https://github.com/trflynn89 ✅
@@ -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();
|
||||
})))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user