I have an application that uses Qt WebEngine. But I found that after closing my application or after crashing it "Qtwebengineprocess" still stays on. My app is too big to show it here, but here is a little example which also demostrates the problem:
#include <QApplication>
#include <QWebEngineView>
#include <QProcess>
#include <QTimer>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QWebEngineView* viewer = new QWebEngineView(NULL);
viewer->show();
viewer->load(QUrl("https://www.telegraph.co.uk/content/dam/Pets/spark/royal-canin/tabby-kitten-small.jpg?imwidth=1400"));
QTimer::singleShot(2000, []() {
exit(-1);
});
app.exec();
delete viewer;
return 0;
}
Did I forget to set up some thing? Or this is a Qt bug? Thanks in advance.
UPD: Qt 5.11, Win10
I found actual issue and solution - here . This is Qt 5.11 bug that describes exactly this problem.
And one of the comments had solution that worked for me:
When running with QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
at the top of the main() function, I'm observing that the qtwebengine process closes correctly,
both when stopping the debugger and when the release exe crashes.
Just added that line before creation of my qApp
and saw no crash whatsoever. Of course this comes with benefits and disadvantages of using ANGLE vs dynamic GPU on Qt, more details here.