summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Document.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-10-17 10:46:11 +0200
committerAndreas Kling <kling@serenityos.org>2022-10-20 15:16:23 +0200
commit6e0f80fbe0f9ca5d411de4887d548c17cea11097 (patch)
tree9ae2d6ab11175e434507f40f97c3832d6aca4089 /Userland/Libraries/LibWeb/DOM/Document.h
parent68452c749a9c1f7077b21b7500aff0d754464129 (diff)
downloadserenity-6e0f80fbe0f9ca5d411de4887d548c17cea11097.zip
LibWeb: Make the HTMLParser GC-allocated
This prevents a reference cycle between a HTMLParser opened via document.open() and the document. It was one of many things keeping some documents alive indefinitely.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Document.h')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h
index c0b136b364..c8417fd514 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.h
+++ b/Userland/Libraries/LibWeb/DOM/Document.h
@@ -428,7 +428,7 @@ public:
void unload(bool recursive_flag = false, Optional<DocumentUnloadTimingInfo> = {});
// https://html.spec.whatwg.org/multipage/dom.html#active-parser
- RefPtr<HTML::HTMLParser> active_parser();
+ JS::GCPtr<HTML::HTMLParser> active_parser();
// https://html.spec.whatwg.org/multipage/dom.html#load-timing-info
DocumentLoadTimingInfo& load_timing_info() { return m_load_timing_info; }
@@ -478,7 +478,7 @@ private:
RefPtr<Platform::Timer> m_style_update_timer;
RefPtr<Platform::Timer> m_layout_update_timer;
- RefPtr<HTML::HTMLParser> m_parser;
+ JS::GCPtr<HTML::HTMLParser> m_parser;
bool m_active_parser_was_aborted { false };
String m_source;