Free GPU textures when adding a file

This commit is contained in:
Jaime Ita Passos 2020-11-22 18:23:35 -03:00
parent 0645c642d2
commit 2e21168395
1 changed files with 5 additions and 0 deletions

View File

@ -4498,6 +4498,11 @@ boolean P_AddWadFile(const char *wadfilename)
if (!devparm && digmreplaces)
CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces));
#ifdef HWRENDER
// Free GPU textures before freeing patches.
if (vid.glstate == VID_GL_LIBRARY_LOADED)
HWR_ClearAllTextures();
#endif
//
// search for sprite replacements