Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.15.2
-
VS2017, Window 10, Qt 5.15.2
Description
I was faced with a problem, that after closing QDialog with web content, the QWebEngineProcess.exe process is not closing, only if close the whole application
Here is a fast example:
#include <QApplication> #include <QWebEngineView> #include <QWebEngineSettings> #include <QDialog> #include <QMainWindow> #include <QLayout> #include <QtGui> #include <QPushButton> class Dialog : public QDialog { public: Dialog() : QDialog(nullptr) { resize(512, 512); setAttribute(Qt::WA_DeleteOnClose); auto verticalLayout = new QVBoxLayout(this); verticalLayout->setSpacing(0); verticalLayout->setContentsMargins(0, 0, 0, 0); m_webView = new QWebEngineView(this); verticalLayout->addWidget(m_webView); } void openPage(const QUrl& url) { m_webView->setUrl(url); } private: QWebEngineView* m_webView; }; class MainWindow : public QMainWindow { public: MainWindow() : QMainWindow(nullptr) { resize(512, 512); QPushButton* btn = new QPushButton("open web dialog", this); connect(btn, &QPushButton::clicked, [this] () { if (m_dialog == nullptr) { m_dialog = new Dialog(); m_dialog->openPage(QUrl("https://www.qt.io")); m_dialog->show(); } }); } private: QPointer<Dialog> m_dialog; }; int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("QtExamples"); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); MainWindow window; window.show(); return app.exec(); }
Steps:
- **Execute attached code
- Click open web dialog
- We will observe 2 QtWebEngineProcess.exe
- Close dialog
- We will observe 1 QtWebEngineProcess.exe
Actual behavior:
After closing QDialog - QtWebEngineProcess.exe exist in process tree until the application will be closed
Expected behavior:
After closing QDialog - QtWebEngineProcess.exe disappears from the process tree
Notes:
Additionally tested delete m_webView ptr, delete QDialog and etc. Nothing works.
If I'll try to kill the process - it will create another QtWebEngineProcess and close the first one
Attachments
Issue Links
- duplicates
-
QTBUG-88575 Spawned QtWebEngineProcess(es) aren't killed after WebEngineView destruction
-
- Closed
-