mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
LibWeb: Fix Document construction mishap in <template> element
Ref-counted objects must not be stack allocated. Make DOM::Document's constructor private to avoid this issue. (I wish we could mark classes as heap-only..)
This commit is contained in:
parent
691b105885
commit
46c15276e9
7 changed files with 11 additions and 9 deletions
|
@ -40,7 +40,7 @@ NonnullRefPtr<IRCLogBuffer> IRCLogBuffer::create()
|
|||
|
||||
IRCLogBuffer::IRCLogBuffer()
|
||||
{
|
||||
m_document = adopt(*new Web::DOM::Document);
|
||||
m_document = Web::DOM::Document::create();
|
||||
m_document->append_child(adopt(*new Web::DOM::DocumentType(document())));
|
||||
auto html_element = m_document->create_element("html");
|
||||
m_document->append_child(html_element);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue