diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-06-29 14:53:31 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-01 11:36:51 +0000 |
commit | 6b8070d5a9598caa1c42753bb9034eb6137e7237 (patch) | |
tree | 10e38da8306ae34d7a09df96b60a6a2399b7ccaa /src/quick/scenegraph/qsgdefaultrendercontext.cpp | |
parent | 7019f7c3237d1894ad2e3ccc4ca9c366a9bba2e4 (diff) |
Make QSGRenderContext::invalidate a no-op
Calling invalidate() from the destructor is a bad idea since what we get
is the QSGRenderContext implementation, not the one from the more-derived
class. (it could have been intentional as well - it is confusing in any case
and unnecessary).
There is no adaptation relying in this anyways - invalidate() is always
invoked manually, typically from windowDestroyed. This is very good since it
avoids the at first less-than-obvious trouble with emitting invalidated()
from the rendercontext dtor. (that can in turn can trigger random amount of
code potentially calling back into the rendercontext and rely on virtuals
which are not functional anymore due to the vtable not there for the
functions in the more-derived class)
Change-Id: I44d78c5a819230f7006d33d4341eff45d8f77c88
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultrendercontext.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultrendercontext.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgdefaultrendercontext.cpp b/src/quick/scenegraph/qsgdefaultrendercontext.cpp index 870c0488c3..4fcc81fb18 100644 --- a/src/quick/scenegraph/qsgdefaultrendercontext.cpp +++ b/src/quick/scenegraph/qsgdefaultrendercontext.cpp @@ -163,7 +163,8 @@ void QSGDefaultRenderContext::invalidate() m_gl->setProperty(QSG_RENDERCONTEXT_PROPERTY, QVariant()); m_gl = 0; - QSGRenderContext::invalidate(); + m_sg->renderContextInvalidated(this); + emit invalidated(); } static QBasicMutex qsg_framerender_mutex; |