diff --git a/QtScrcpy/render/qyuvopenglwidget.cpp b/QtScrcpy/render/qyuvopenglwidget.cpp index 02c1c2e..33c8788 100644 --- a/QtScrcpy/render/qyuvopenglwidget.cpp +++ b/QtScrcpy/render/qyuvopenglwidget.cpp @@ -221,7 +221,10 @@ void QYUVOpenGLWidget::initTextures() void QYUVOpenGLWidget::deInitTextures() { - glDeleteTextures(3, m_texture); + if (QOpenGLFunctions::isInitialized(QOpenGLFunctions::d_ptr)) { + glDeleteTextures(3, m_texture); + } + memset(m_texture, 0, 3); m_textureInited = false; }