Try to search your question here, if you can't find : Ask Any Question Now ?

I get "Release of profile requested but WebEnginePage still not deleted. Expect troubles !" when PyQt5 application exits

HomeCategory: stackoverflowI get "Release of profile requested but WebEnginePage still not deleted. Expect troubles !" when PyQt5 application exits
Avatarcraig asked 2 weeks ago

When my Python 3.x apps exists, I get a message on the console

Release of profile requested but WebEnginePage still not deleted. Expect troubles !

and then python crashes

Windows 10 64 bit
Python 3.72 (32 bits)
PyQt5 4.19.18

Googled around an seen people reporting the problem (sometimes in C++), but not clear indication of what to do.

pretty simple case:

class PmApplication(QMainWindow):
(...) 
     summary=QWebEngineView(self)
(...)
     tabWidget.addTab(summary,"Summary")

and at some point, I generate an HTML document with mako in another class that manages notifications (so, self.web points to summary)

    data.trip = con.execute(sql).fetchall()
    html = self.template.render(d=data)
    self.web.setHtml(html)
    self.web.show()

This works fine until I close the application

I use PyDev, and while ran inside eclipse, I just see alert dialog from Python telling it crashed.

From the command line, I get

Release of profile requested but WebEnginePage still not deleted. Expect troubles !

and then the same dialog from Python

any pointer ? (also, new to python and PyQt5)

thanks

As suggested (and as I should have done), here’s a minimal snippet that reproduces the problem

from PyQt5.QtWebEngine import QtWebEngine
from PyQt5 import QtCore,QtWidgets
from PyQt5.QtWidgets import QMainWindow,QWidget
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtWebEngineWidgets import QWebEngineSettings
from PyQt5.Qt import QHBoxLayout
import sys

def main():
    app = QtWidgets.QApplication(sys.argv)
    pm = QMainWindow()
    centralWidget = QWidget(pm)  
    summary=QWebEngineView(pm)
    box = QHBoxLayout()
    box.addWidget(summary)
    centralWidget.setLayout(box)
    html = "<html><head><title>Here goes</title></head><body> Does this work ?</body></html>"
    summary.setHtml(html)
    pm.show()
    sys.exit( app.exec_() )


if __name__ == "__main__":
    main()

1 Answers
Best Answer
Avatarnaveen answered 2 weeks ago
Your Answer

0 + 18 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com