diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2016-10-27 09:57:54 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-11-11 15:34:19 +0000 |
commit | 3654a401f8e046e2fa5a340d0380cc0088a03048 (patch) | |
tree | 1b7f1ffbadd03d78a2b899577c57dd232218e105 /src/gui/kernel/qopenglcontext_p.h | |
parent | e79b40ee8f78a9669ed0b7b6def2a69ef7ab02fa (diff) |
Prevent stale QOpenGLContext fbo pointer
There is logic for clearing the qgl_curent_fbo pointer
in release(), but it is not always called, causing
the pointer to become stale on QOpenGLFramebufferObject
deletion.
As a last resort, clear the qgl_curent_fbo pointer
on the current context if it’s pointing to the object
that is being deleted.
Change-Id: I0a91d686cec5fcbe4c1520a9ba96cea833bb2249
Task-number: QTBUG-56639
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/kernel/qopenglcontext_p.h')
-rw-r--r-- | src/gui/kernel/qopenglcontext_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h index 2fe8446c65..736f816bfe 100644 --- a/src/gui/kernel/qopenglcontext_p.h +++ b/src/gui/kernel/qopenglcontext_p.h @@ -264,7 +264,7 @@ public: static QOpenGLContextPrivate *get(QOpenGLContext *context) { - return context->d_func(); + return context ? context->d_func() : Q_NULLPTR; } #if !defined(QT_NO_DEBUG) |