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

QQuickRenderControl destructor breaks deleteLater

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      Under normal conditions it should be safe to rely on deleteLater() to not be processed until we hit the event loop

      HoweverQQuickRenderControlPrivate::windowDestroyed contains the line

              QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);

       

      which gives very strange behaviour in client code.This will crash at the second debug statement

          auto obj = new QObject(this);
          obj->setProperty("DAVE", "DAVE");
          obj->deleteLater();
          qDebug() << obj->property("DAVE");
          {
              QQuickRenderControl c;
              QQuickWindow w(&c);
          }
          qDebug() << obj->property("DAVE");
      

      Guarding all possible usage of objects that might be used in the same event as the destruction of a QQuickwindow in a render control simply isn't feasible.

       

      Attachments

        1. rendercontrolcrash.zip
          390 kB
          David Edmundson
        For Gerrit Dashboard: QTBUG-68997
        # Subject Branch Project Status CR V

        Activity

          People

            davidedmundson David Edmundson
            davidedmundson David Edmundson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes