0023630: Incorrect NULL check in OpenGl_Workspace::EnableTexture()
authorkgv <kgv@opencascade.com>
Tue, 11 Dec 2012 13:57:50 +0000 (17:57 +0400)
committerkgv <kgv@opencascade.com>
Fri, 14 Dec 2012 12:44:24 +0000 (16:44 +0400)
src/OpenGl/OpenGl_Workspace.cxx

index 1628334..3f1bd81 100644 (file)
@@ -408,11 +408,11 @@ Handle(OpenGl_Texture) OpenGl_Workspace::EnableTexture (const Handle(OpenGl_Text
     return DisableTexture();
   }
 
-  if (myTextureBound.IsNull() && myTextureBound == theTexture)
+  if (myTextureBound == theTexture
+   && (theParams.IsNull() || theParams == theTexture->GetParams()))
   {
-    Handle(OpenGl_Texture) aPrevTexture = myTextureBound;
-    myTextureBound = theTexture;
-    return aPrevTexture;
+    // already bound
+    return myTextureBound;
   }
 
   Handle(OpenGl_Texture) aPrevTexture = DisableTexture();