mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
ref: gl: fix detail texture leak, fix texture leak when texture have default texture set (in which case it still might have other textures set)
This commit is contained in:
@@ -88,11 +88,13 @@ static void Mod_BrushUnloadTextures( model_t *mod )
|
||||
for( i = 0; i < mod->numtextures; i++ )
|
||||
{
|
||||
texture_t *tx = mod->textures[i];
|
||||
if( !tx || tx->gl_texturenum == tr.defaultTexture )
|
||||
if( !tx )
|
||||
continue; // free slot
|
||||
|
||||
GL_FreeTexture( tx->gl_texturenum ); // main texture
|
||||
GL_FreeTexture( tx->fb_texturenum ); // luma texture
|
||||
if( tx->gl_texturenum != tr.defaultTexture )
|
||||
GL_FreeTexture( tx->gl_texturenum ); // main texture
|
||||
GL_FreeTexture( tx->fb_texturenum ); // luma texture
|
||||
GL_FreeTexture( tx->dt_texturenum ); // detail texture
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user