Fix application crash when calling Shader::isAvailable() #608.

This commit is contained in:
Lukas Dürrenberger 2014-05-23 10:43:51 +02:00
parent 2215f55ef9
commit a3ab6efa23

View File

@ -340,6 +340,9 @@ void RenderTarget::popGLStates()
////////////////////////////////////////////////////////////
void RenderTarget::resetGLStates()
{
// Check here to make sure a context change does not happen after activate(true)
bool shaderAvailable = Shader::isAvailable();
if (activate(true))
{
// Make sure that extensions are initialized
@ -362,7 +365,7 @@ void RenderTarget::resetGLStates()
applyBlendMode(BlendAlpha);
applyTransform(Transform::Identity);
applyTexture(NULL);
if (Shader::isAvailable())
if (shaderAvailable)
applyShader(NULL);
m_cache.useVertexCache = false;