diff options
author | Pavel Golikov <Paullo612@ya.ru> | 2016-07-06 15:22:31 +0300 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@qt.io> | 2016-07-06 14:22:04 +0000 |
commit | 278fd530f0ad883f88e15d3403f1ab63fbdeb131 (patch) | |
tree | dbe1c3d6ba4a9b2e74cd189b5ce472cbfe647043 | |
parent | fd89c0946a378812121615ab6b8a3ad1ae93d4fb (diff) |
Android: Fix OpenGL texture name leak
This fixes texture name leak when changing media player's source. Texture name
shold be deleted by OpenGLResourcesDeleter class, but when player's source is
changed OpenGLResourcesDeleter's texture name is reassigned with new one
without old name deletion.
This change deletes OpenGLResourcesDeleter's current texture name when new name
is assigned.
Task-number: QTBUG-54340
Change-Id: I22bbd60b4462b0034fd115f0582ea43b9bcaee4b
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
-rw-r--r-- | src/plugins/android/src/common/qandroidvideooutput.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/android/src/common/qandroidvideooutput.cpp b/src/plugins/android/src/common/qandroidvideooutput.cpp index f69be679a..f462a28d5 100644 --- a/src/plugins/android/src/common/qandroidvideooutput.cpp +++ b/src/plugins/android/src/common/qandroidvideooutput.cpp @@ -141,7 +141,13 @@ public: delete m_program; } - void setTexture(quint32 id) { m_textureID = id; } + void setTexture(quint32 id) { + if (m_textureID) + glDeleteTextures(1, &m_textureID); + + m_textureID = id; + } + void setFbo(QOpenGLFramebufferObject *fbo) { m_fbo = fbo; } void setShaderProgram(QOpenGLShaderProgram *prog) { m_program = prog; } |