diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2016-07-19 13:48:33 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2016-07-26 14:58:54 +0000 |
commit | 107ac187bcc3c552217181a3b247ed5f31a9cb49 (patch) | |
tree | dba356ab781a3a0e4bba55c6567e7370a92ec9f0 | |
parent | d9831a03ca3bd8a9a86ae37f1e18d48c9cc3fb9f (diff) |
QOpenGLDebugLogger: do not crash if deleted with the wrong GL context current
Task-number: QTBUG-54799
Change-Id: Ifee3183e7944fbe266fe644628d33d0667be99a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/gui/opengl/qopengldebug.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/opengl/qopengldebug.cpp b/src/gui/opengl/qopengldebug.cpp index 8b2ffb1a20..99d1e691c9 100644 --- a/src/gui/opengl/qopengldebug.cpp +++ b/src/gui/opengl/qopengldebug.cpp @@ -1500,6 +1500,12 @@ void QOpenGLDebugLogger::stopLogging() if (!d->isLogging) return; + QOpenGLContext *currentContext = QOpenGLContext::currentContext(); + if (!currentContext || currentContext != d->context) { + qWarning("QOpenGLDebugLogger::stopLogging(): attempting to stop logging with the wrong OpenGL context current"); + return; + } + d->isLogging = false; d->glDebugMessageCallback(d->oldDebugCallbackFunction, d->oldDebugCallbackParameter); |