summaryrefslogtreecommitdiffstats
path: root/gfx/gl/GLContextProviderWGL.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-20 22:35:36 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-20 22:42:14 +0100
commitc6dbf554496191a0cfe4c8f5dbe8c96031d1445b (patch)
tree72c14ce62e8de6f6f2273799b7badf445ced07d4 /gfx/gl/GLContextProviderWGL.cpp
parent722161775b9ec9314d1b02f567e42b83115cf993 (diff)
downloadUXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.tar
UXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.tar.gz
UXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.tar.lz
UXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.tar.xz
UXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.zip
Issue #1354 - Clear the current context when MakeCurrent() fails.
Diffstat (limited to 'gfx/gl/GLContextProviderWGL.cpp')
-rw-r--r--gfx/gl/GLContextProviderWGL.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/gfx/gl/GLContextProviderWGL.cpp b/gfx/gl/GLContextProviderWGL.cpp
index 35957259d..da8c93d10 100644
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -314,20 +314,17 @@ GLContextWGL::Init()
if (!mDC || !mContext)
return false;
- // see bug 929506 comment 29. wglGetProcAddress requires a current context.
- if (!sWGLLib.fMakeCurrent(mDC, mContext))
- return false;
-
SetupLookupFunction();
- if (!InitWithPrefix("gl", true))
- return false;
-
- return true;
+ return InitWithPrefix("gl", true);
}
bool
GLContextWGL::MakeCurrentImpl(bool aForce)
{
+ if (IsDestroyed()) {
+ MOZ_ALWAYS_TRUE(sWGLLib.fMakeCurrent(0, 0));
+ }
+
BOOL succeeded = true;
// wglGetCurrentContext seems to just pull the HGLRC out