diff options
author | Joni Poikelin <joni.poikelin@qt.io> | 2017-08-17 09:49:25 +0300 |
---|---|---|
committer | Joni Poikelin <joni.poikelin@qt.io> | 2017-08-22 04:53:19 +0000 |
commit | 768f606cd3cd37c235e85225127201a42d272946 (patch) | |
tree | e8798f5ccca6c311ec8af518a6306888d9867198 /src/quick | |
parent | 93ff90d943825b4acb572a37c6514367c390d5b1 (diff) |
Fix memory leaks with threaded renderer
Reverts 39061af50cc3092289cdd71d17802139590ecb59 and calls endSync()
instead after syncSceneGraph().
Task-number: QTBUG-61754
Change-Id: I7b51ffdc93557bacd93927dd642ec3715980b21c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Roger Zanoni <rogerzanoni@gmail.com>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgatlastexture.cpp | 7 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgatlastexture_p.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 3a8e673c0d..d28a73da20 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -553,6 +553,7 @@ void QSGRenderThread::sync(bool inExpose) if (d->renderer) d->renderer->clearChangedFlag(); d->syncSceneGraph(); + sgrc->endSync(); if (!hadRenderer && d->renderer) { qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- renderer was created"; syncResultedInChanges = true; diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp index d5f836a525..22f0b13f46 100644 --- a/src/quick/scenegraph/util/qsgatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgatlastexture.cpp @@ -116,7 +116,7 @@ QSGTexture *Manager::create(const QImage &image, bool hasAlphaChannel) Texture *t = 0; if (image.width() < m_atlas_size_limit && image.height() < m_atlas_size_limit) { if (!m_atlas) - m_atlas = new Atlas(m_atlas_size, this); + m_atlas = new Atlas(m_atlas_size); // t may be null for atlas allocation failure t = m_atlas->create(image); if (t && !hasAlphaChannel && t->hasAlphaChannel()) @@ -125,9 +125,8 @@ QSGTexture *Manager::create(const QImage &image, bool hasAlphaChannel) return t; } -Atlas::Atlas(const QSize &size, QObject *parent) - : QObject(parent) - , m_allocator(size) +Atlas::Atlas(const QSize &size) + : m_allocator(size) , m_texture_id(0) , m_size(size) , m_atlas_transient_image_threshold(0) diff --git a/src/quick/scenegraph/util/qsgatlastexture_p.h b/src/quick/scenegraph/util/qsgatlastexture_p.h index 0bb07e8e89..3dee539547 100644 --- a/src/quick/scenegraph/util/qsgatlastexture_p.h +++ b/src/quick/scenegraph/util/qsgatlastexture_p.h @@ -88,7 +88,7 @@ private: class Atlas : public QObject { public: - Atlas(const QSize &size, QObject *parent); + Atlas(const QSize &size); ~Atlas(); void invalidate(); |