diff options
Diffstat (limited to 'src/quick/scenegraph/qsgcontext.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 1eeb9441b8..829d33a0d7 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -358,6 +358,12 @@ QSGRenderContext::~QSGRenderContext() invalidate(); } +void QSGRenderContext::endSync() +{ + qDeleteAll(m_texturesToDelete); + m_texturesToDelete.clear(); +} + static QBasicMutex qsg_framerender_mutex; void QSGRenderContext::renderNextFrame(QSGRenderer *renderer, GLuint fboId) @@ -475,6 +481,9 @@ void QSGRenderContext::invalidate() if (!m_gl) return; + qDeleteAll(m_texturesToDelete); + m_texturesToDelete.clear(); + qDeleteAll(m_textures.values()); m_textures.clear(); @@ -617,10 +626,8 @@ QSGTexture *QSGRenderContext::textureForFactory(QQuickTextureFactory *factory, Q void QSGRenderContext::textureFactoryDestroyed(QObject *o) { m_mutex.lock(); - QSGTexture *t = m_textures.take(static_cast<QQuickTextureFactory *>(o)); + m_texturesToDelete << m_textures.take(static_cast<QQuickTextureFactory *>(o)); m_mutex.unlock(); - if (t) - t->deleteLater(); } QT_END_NAMESPACE |