summaryrefslogtreecommitdiff
path: root/Ladybird/SimpleWebView.cpp
diff options
context:
space:
mode:
authorAndrew Kaster <andrewdkaster@gmail.com>2022-10-01 12:46:24 -0600
committerAndrew Kaster <andrewdkaster@gmail.com>2022-12-25 07:58:58 -0700
commit2ff37d7e1342c1f4da41eb5b25ddc9e78aa24df2 (patch)
tree57bc5c1f03c3a886ddd952943d69afbdaabb3d38 /Ladybird/SimpleWebView.cpp
parentf9af2832c80c9f0239c719c3a3882b1e4bc75bcb (diff)
downloadserenity-2ff37d7e1342c1f4da41eb5b25ddc9e78aa24df2.zip
Ladybird/Everywhere: Ensure that Qt objects are created with parents
This prevents memory leaks detected by both Valgrind and ASAN/LSAN. Valgrind is still suspicious of the leaked JS::VM from Web::Bindings::main_thread_vm() but there's other issues with leak checking all the GC'd objects. Co-Authored-By: Diego Iastrubni <diegoiast@gmail.com>
Diffstat (limited to 'Ladybird/SimpleWebView.cpp')
-rw-r--r--Ladybird/SimpleWebView.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Ladybird/SimpleWebView.cpp b/Ladybird/SimpleWebView.cpp
index f1f0a1df5d..8796e60f0a 100644
--- a/Ladybird/SimpleWebView.cpp
+++ b/Ladybird/SimpleWebView.cpp
@@ -586,13 +586,13 @@ void SimpleWebView::did_get_js_console_messages(i32, Vector<String>, Vector<Stri
void SimpleWebView::ensure_js_console_widget()
{
if (!m_js_console_widget) {
- m_js_console_widget = new QWidget;
+ m_js_console_widget = new QWidget(this);
m_js_console_widget->setWindowTitle("JS Console");
- auto* layout = new QVBoxLayout;
+ auto* layout = new QVBoxLayout(m_js_console_widget);
m_js_console_widget->setLayout(layout);
- m_js_console_output_edit = new QTextEdit;
+ m_js_console_output_edit = new QTextEdit(this);
m_js_console_output_edit->setReadOnly(true);
- m_js_console_input_edit = new QLineEdit;
+ m_js_console_input_edit = new QLineEdit(this);
layout->addWidget(m_js_console_output_edit);
layout->addWidget(m_js_console_input_edit);
m_js_console_widget->resize(640, 480);