aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickrendercontrol.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-11-17 16:11:22 +0100
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-11-18 14:23:08 +0100
commita29337be6ea54557498202ee99df1325238ea19a (patch)
tree3e7d54fd66bdda5578109ff0f67fbc8daeb39592 /src/quick/items/qquickrendercontrol.cpp
parent10b6e6a06d929358bc693a6d5d535c36dc03fe14 (diff)
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: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/items/qquickrendercontrol.cpp')
-rw-r--r--src/quick/items/qquickrendercontrol.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index e433e55873..a666bb59c9 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -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;
}