summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2016-07-19 13:48:33 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2016-07-26 14:58:54 +0000
commit107ac187bcc3c552217181a3b247ed5f31a9cb49 (patch)
treedba356ab781a3a0e4bba55c6567e7370a92ec9f0
parentd9831a03ca3bd8a9a86ae37f1e18d48c9cc3fb9f (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.cpp6
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);