Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.11.0
-
None
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.