1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-20 03:32:10 +00:00

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>
This commit is contained in:
Andrew Kaster 2022-10-01 12:46:24 -06:00
parent f9af2832c8
commit 2ff37d7e13
7 changed files with 41 additions and 41 deletions

View file

@ -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);