mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00:00
LibWeb: Use Core::Timer
for cursor blink timer in BrowsingContext
Using `Core::Timer` that doesn't implicitly convert callback to `JS::SafeFunction` fixes the bug when `BrowsingContext` is never destroyed because of cyclic dependency between callback and `BrowsingContext`.
This commit is contained in:
parent
dfb5ba0e2c
commit
b2b99aba95
2 changed files with 3 additions and 3 deletions
|
@ -439,14 +439,14 @@ BrowsingContext::BrowsingContext(Page& page, HTML::NavigableContainer* container
|
|||
, m_event_handler({}, *this)
|
||||
, m_container(container)
|
||||
{
|
||||
m_cursor_blink_timer = Platform::Timer::create_repeating(500, [this] {
|
||||
m_cursor_blink_timer = Core::Timer::create_repeating(500, [this] {
|
||||
if (!is_focused_context())
|
||||
return;
|
||||
if (m_cursor_position.node() && m_cursor_position.node()->layout_node()) {
|
||||
m_cursor_blink_state = !m_cursor_blink_state;
|
||||
m_cursor_position.node()->layout_node()->set_needs_display();
|
||||
}
|
||||
});
|
||||
}).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
BrowsingContext::~BrowsingContext() = default;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue