From a96e78bca5f63309e83b9885ca78f6aa2a5ea630 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 20 Sep 2020 16:46:51 +0200 Subject: [PATCH] source/Platform/Win32/Win32GLContext.cpp: in createGLContext() check return value from ensureExtensionsLoaded() --- source/Platform/Win32/Win32GLContext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/Platform/Win32/Win32GLContext.cpp b/source/Platform/Win32/Win32GLContext.cpp index bc5e860..a7153b7 100644 --- a/source/Platform/Win32/Win32GLContext.cpp +++ b/source/Platform/Win32/Win32GLContext.cpp @@ -107,7 +107,9 @@ void Win32GLContext::createGLContext() tmpDC = ::wglCreateContext(m_deviceContext); ::wglMakeCurrent(m_deviceContext, tmpDC); - ensureExtensionsLoaded(m_deviceContext); + if (!ensureExtensionsLoaded(m_deviceContext)) { + goto err; + } // TODO: For now.. We force 3.2 Core but this should not be implementation specific. // The Display class should force that for all GLContext Implementations. @@ -122,6 +124,7 @@ void Win32GLContext::createGLContext() // Create real context. m_renderContext = ::wglCreateContextAttribsARB(m_deviceContext, 0, attriblist); +err: // Dont need the old one anymore. wglMakeCurrent(m_deviceContext, NULL); ::wglDeleteContext(tmpDC);