Issue #1354 - Clear the current context when MakeCurrent() fails.

This commit is contained in:
wolfbeast 2020-01-20 22:35:36 +01:00 committed by Roy Tam
commit 9d76eb5791
10 changed files with 81 additions and 95 deletions

View file

@ -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