From 1de63bec5089e64b1bf6bc7eaad95d5210f0fd05 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 13 Apr 2012 15:47:44 -0500 Subject: MAINT-861 Fix for crash on exit due to bad matrix mode --- indra/llrender/llrender.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index b0ddacbb05..51f45ca91e 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -416,12 +416,14 @@ void LLTexUnit::unbind(eTextureType type) if (mIndex < 0) return; + //always flush and activate for consistency + // some code paths assume unbind always flushes and sets the active texture + gGL.flush(); + activate(); + // Disabled caching of binding state. if (mCurrTexType == type) { - gGL.flush(); - - activate(); mCurrTexture = 0; if (LLGLSLShader::sNoFixedFunction && type == LLTexUnit::TT_TEXTURE) { -- cgit v1.2.3