diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-20 22:35:36 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-20 22:42:14 +0100 |
commit | c6dbf554496191a0cfe4c8f5dbe8c96031d1445b (patch) | |
tree | 72c14ce62e8de6f6f2273799b7badf445ced07d4 /gfx/gl/GLContextProviderWGL.cpp | |
parent | 722161775b9ec9314d1b02f567e42b83115cf993 (diff) | |
download | UXP-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.cpp | 13 |
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 |