diff --git a/Ladybird/WebContentView.cpp b/Ladybird/WebContentView.cpp index 3dee9df3f18..1c2af12c2be 100644 --- a/Ladybird/WebContentView.cpp +++ b/Ladybird/WebContentView.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -607,8 +606,10 @@ void WebContentView::create_client() auto new_client = MUST(adopt_nonnull_ref_or_enomem(new (nothrow) WebView::WebContentClient(std::move(socket), *this))); new_client->set_fd_passing_socket(MUST(Core::Stream::LocalSocket::adopt_fd(ui_fd_passing_fd))); - auto* notifier = new QSocketNotifier(new_client->socket().fd().value(), QSocketNotifier::Type::Read); - QObject::connect(notifier, &QSocketNotifier::activated, [new_client = new_client.ptr()] { + m_web_content_notifier.setSocket(new_client->socket().fd().value()); + m_web_content_notifier.setEnabled(true); + + QObject::connect(&m_web_content_notifier, &QSocketNotifier::activated, [new_client = new_client.ptr()] { if (auto notifier = new_client->socket().notifier()) notifier->on_ready_to_read(); }); diff --git a/Ladybird/WebContentView.h b/Ladybird/WebContentView.h index 2572272e2c9..008e51b44ad 100644 --- a/Ladybird/WebContentView.h +++ b/Ladybird/WebContentView.h @@ -19,11 +19,11 @@ #include #include #include -#include - #include +#include #include #include +#include class QTextEdit; class QLineEdit; @@ -196,6 +196,7 @@ private: Gfx::IntRect m_viewport_rect; void handle_web_content_process_crash(); + QSocketNotifier m_web_content_notifier { QSocketNotifier::Type::Read }; RefPtr m_backup_bitmap;