From f939c3728cc2d7c6946b62f45e8401542e3fe1a0 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 15 Jan 2015 15:10:20 +0100 Subject: Bail out in composeAndFlush when makeCurrent fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And show a warning so we have a chance of knowing what happened. Change-Id: I9ddf3842b7d19946876ac1a2375611e8c13bbb9a Reviewed-by: Jørgen Lind --- src/gui/painting/qplatformbackingstore.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index 0d550887d9..8e50059ca4 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -237,7 +237,11 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion ®i { Q_UNUSED(offset); - context->makeCurrent(window); + if (!context->makeCurrent(window)) { + qWarning("composeAndFlush: makeCurrent() failed"); + return; + } + QOpenGLFunctions *funcs = context->functions(); funcs->glViewport(0, 0, window->width() * window->devicePixelRatio(), window->height() * window->devicePixelRatio()); funcs->glClearColor(0, 0, 0, translucentBackground ? 0 : 1); -- cgit v1.2.3