diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 3c033ea39e..7588c36c9b 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -510,8 +510,10 @@ void QOpenGLContext::setScreen(QScreen *screen) void QOpenGLContextPrivate::_q_screenDestroyed(QObject *object) { Q_Q(QOpenGLContext); - if (object == static_cast(screen)) + if (object == static_cast(screen)) { + screen = 0; q->setScreen(0); + } } /*!