LibWeb: Capture weak this ptr in HTMLTextAreaElement input callback

Fixes GC-leak caused by cycle dependency between input callback and
HTMLTextAreaElement that owns it.
This commit is contained in:
Aliaksandr Kalenik
2024-03-16 11:44:18 +01:00
committed by Tim Flynn
parent 9eb38ce79c
commit e0713376a0
2 changed files with 7 additions and 3 deletions

View File

@@ -8,11 +8,11 @@
#pragma once
#include <LibCore/Timer.h>
#include <LibWeb/ARIA/Roles.h>
#include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/FormAssociatedElement.h>
#include <LibWeb/HTML/HTMLElement.h>
#include <LibWeb/Platform/Timer.h>
#include <LibWeb/WebIDL/Types.h>
namespace Web::HTML {
@@ -128,7 +128,7 @@ private:
JS::GCPtr<DOM::Element> m_inner_text_element;
JS::GCPtr<DOM::Text> m_text_node;
RefPtr<Web::Platform::Timer> m_input_event_timer;
RefPtr<Core::Timer> m_input_event_timer;
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-dirty
bool m_dirty_value { false };