- fixed: The texture for legacy dynamic light handling was always allocated, even if not needed, and it was never freed.

This commit is contained in:
Christoph Oelckers 2017-01-11 10:47:45 +01:00
parent d1ce098d59
commit 72101473d0
2 changed files with 3 additions and 2 deletions

View File

@ -164,7 +164,7 @@ void FGLRenderer::Initialize(int width, int height)
}
else mVAOID = 0;
gllight = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/gllight.png"), FTexture::TEX_MiscPatch);
if (gl.legacyMode) gllight = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/gllight.png"), FTexture::TEX_MiscPatch);
glpart2 = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart2.png"), FTexture::TEX_MiscPatch);
glpart = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart.png"), FTexture::TEX_MiscPatch);
mirrortexture = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/mirror.png"), FTexture::TEX_MiscPatch);
@ -196,6 +196,7 @@ FGLRenderer::~FGLRenderer()
if (mLights != NULL) delete mLights;
if (glpart2) delete glpart2;
if (glpart) delete glpart;
if (gllight) delete gllight;
if (mirrortexture) delete mirrortexture;
if (mFBID != 0) glDeleteFramebuffers(1, &mFBID);
if (mVAOID != 0)

View File

@ -1337,7 +1337,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE nothing, LPSTR cmdline, int n
_CrtSetDbgFlag (_CrtSetDbgFlag(0) | _CRTDBG_LEAK_CHECK_DF);
// Use this to break at a specific allocation number.
//_crtBreakAlloc = 53039;
_crtBreakAlloc = 124459;
#endif
DoMain (hInstance);