From a9c53a9c2c636789498900d8f759c5588dad9483 Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 13 Jun 2013 19:37:38 +0200 Subject: [PATCH] Fixed potential crash Former-commit-id: 2fd792cef599915d9f73a176e462aa8c74b91987 --- src/Nazara/Renderer/GLSLShader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Nazara/Renderer/GLSLShader.cpp b/src/Nazara/Renderer/GLSLShader.cpp index 1d3f0f2fa..9a37ab706 100644 --- a/src/Nazara/Renderer/GLSLShader.cpp +++ b/src/Nazara/Renderer/GLSLShader.cpp @@ -395,12 +395,14 @@ bool NzGLSLShader::SendTexture(int location, const NzTexture* texture, nzUInt8* slot.texture->AddResourceListener(this, location); slot.updated = false; + + if (textureUnit) + *textureUnit = slot.unit; } else m_textures.erase(it); // On supprime le slot } - - if (textureUnit) + else if (textureUnit) *textureUnit = slot.unit; } else if (texture)