Free memory when unused, forgotten in my commit d4feb59e

This commit is contained in:
jean-pierre charras 2022-09-08 13:04:53 +02:00
parent 5b96736059
commit c13b938a4b
1 changed files with 7 additions and 1 deletions

View File

@ -123,8 +123,14 @@ GLuint GL_BITMAP_CACHE::RequestBitmap( const BITMAP_BASE* aBitmap )
{
return it->second.id;
}
else
{
// Delete the invalid bitmap cache and its data
glDeleteTextures( 1, &it->second.id );
m_bitmaps.erase( it );
}
// else if not valid, it will be recreated.
// the cached bitmap is not valid and deleted, it will be recreated.
}
return cacheBitmap( aBitmap );