Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-126401

Qt webengine leaks its WebEngineQuickWidget

    XMLWordPrintable

Details

    • a9357c725 (dev), 1eb8f906a (6.8), 2e6909252 (6.7)

    Description

      Please use this code to reproduce. simply create a webengine and delete.

      #include <QtWidgets/QApplication>
      #include <QtWidgets/QWidget>
      #include <QtWebEngineWidgets/QWebEngineView>
      
      int main(int argc, char** argv)
      {
          QApplication app(argc, argv);
      
          {
              // tlw: red.
              QWidget tlw;
              tlw.resize(640, 480);
              tlw.setStyleSheet("QWidget { background-color: red; }");
      
              QWebEngineView webview(&tlw);
              webview.setGeometry(0, 0, 640, 480);
              webview.setUrl(QUrl("chrome://gpu"));
      
              tlw.show();
              app.exec();
      
              QWidgetList before = QApplication::allWidgets();
              assert(before.size() == 3); // tlw + QWebEngineView + internal QQuickWidget
          }
      
          // internal QQuickWidget leaks.
          QWidgetList leaking = QApplication::allWidgets();
          assert(leaking.size() == 0); // actual size() is 1. expect 0.
          return 0;
      }
      

      After deleting all widgets, there is still a WebEngineQuickWidget alive. The quick widget and its offscreen window are never deleted.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mnegyokru Martin Negyokru
            mingxiang Mingxiang Xu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes