1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 03:07:35 +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:
Andreas Kling 2020-10-23 08:31:26 +02:00
parent 691b105885
commit 46c15276e9
7 changed files with 11 additions and 9 deletions

View file

@ -686,7 +686,7 @@ int main(int argc, char** argv)
main_widget.set_layout<GUI::VerticalBoxLayout>();
auto& view = main_widget.add<Web::InProcessWebView>();
view.set_document(adopt(*new Web::DOM::Document));
view.set_document(Web::DOM::Document::create());
if (show_window) {
window->set_title("LibWeb Test Window");