Commit a29337be authored by Laszlo Agocs's avatar Laszlo Agocs
Browse files

Do not send deferred deletes from QQuickRenderControl::invalidate()


Leave it up to the clients of QQuickRenderControl to do this, if they
want it. It is usually not necessary.

In the single-threaded widget world forcing deferred deletes to execute
on every invalidate(), so for example from the hide event handler of
QQuickWidget, is dangerous because widget apps tend to deleteLater()
all sorts of widgets which can then be destroyed at unexpected times.

From windowDestroyed() we continue to send the deferred deletes, just
like all the render loops do.

Task-number: QTBUG-42618
Task-number: QTBUG-40435
Change-Id: I8189124e2e7675361ee97bd8ba3e88b10ef193fa
Reviewed-by: default avatarGunnar Sletta <gunnar@sletta.org>
parent 10b6e6a0
No related merge requests found
Showing with 4 additions and 1 deletion
......@@ -172,6 +172,10 @@ void QQuickRenderControlPrivate::windowDestroyed()
/*!
Initializes the scene graph resources. The context \a gl has to
be the current context.
\note Qt Quick does not take ownership of the context. It is up to the
application to destroy it after a call to invalidate() or after the
QQuickRenderControl instance is destroyed.
*/
void QQuickRenderControl::initialize(QOpenGLContext *gl)
{
......@@ -274,7 +278,6 @@ void QQuickRenderControl::invalidate()
// application right after returning from this function. Invalidating is
// also essential to allow a subsequent initialize() to succeed.
d->rc->invalidate();
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
d->initialized = false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment