summaryrefslogtreecommitdiff
path: root/src/qtmultimediaquicktools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-11-06 16:24:57 +0100
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2014-11-06 18:19:15 +0100
commit2020b032e83d1b61736a80a6815635aa7451deed (patch)
tree6529a47518c6e102daaa42c9bedbcd019c7e2d05 /src/qtmultimediaquicktools
parente92bcbfa4dc8ea5e78e4c1712fffc9be0104a73e (diff)
downloadqtmultimedia-2020b032e83d1b61736a80a6815635aa7451deed.tar.gz
Check whether current context can be obtained when deleting textures.
Add a warning in that case. Task-number: QTBUG-41966 Change-Id: I491ee9e13c9504040ab789951656983a736d9203 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/qtmultimediaquicktools')
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_i420.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qtmultimediaquicktools/qsgvideonode_i420.cpp b/src/qtmultimediaquicktools/qsgvideonode_i420.cpp
index 5b8b7ce8a..17b4924d0 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_i420.cpp
+++ b/src/qtmultimediaquicktools/qsgvideonode_i420.cpp
@@ -227,8 +227,12 @@ QSGVideoMaterial_YUV420::QSGVideoMaterial_YUV420(const QVideoSurfaceFormat &form
QSGVideoMaterial_YUV420::~QSGVideoMaterial_YUV420()
{
- if (!m_textureSize.isEmpty())
- QOpenGLContext::currentContext()->functions()->glDeleteTextures(Num_Texture_IDs, m_textureIds);
+ if (!m_textureSize.isEmpty()) {
+ if (QOpenGLContext *current = QOpenGLContext::currentContext())
+ current->functions()->glDeleteTextures(Num_Texture_IDs, m_textureIds);
+ else
+ qWarning() << "QSGVideoMaterial_YUV420: Cannot obtain GL context, unable to delete textures";
+ }
}
void QSGVideoMaterial_YUV420::bind()