TexMgr_ReloadImages: put in a workaround for the bug reported by Steven where fullscreen toggle on jam3_tronyn.bsp with -heapsize 65536 causes corrupted textures

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1162 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Eric Wasylishen 2015-02-06 05:21:39 +00:00
parent bc89fbea05
commit 7be39c651e

View file

@ -1389,6 +1389,13 @@ void TexMgr_ReloadImages (void)
{
gltexture_t *glt;
// ericw -- flush the cache before reloading textures. This avoids an obscure
// bug where, if the hunk is almost full, an allocation in TexMgr_ReloadImage
// triggers cache items to be freed, which calls back into TexMgr to free the
// texture. Calling TexMgr_FreeTexture within the loop below causes things to
// go haywire. A test case is jam3_tronyn.bsp with -heapsize 65536
Cache_Flush();
for (glt = active_gltextures; glt; glt = glt->next)
{
glGenTextures(1, &glt->texnum);