Skip to content

Commit 3ccbcda

Browse files
Fix bmodel buffer leak (#489)
1 parent 6a9610f commit 3ccbcda

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Quake/gl_rmisc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ void R_NewMap (void)
517517
VEC_CLEAR (r_pointfile);
518518

519519
GL_BuildLightmaps ();
520+
GL_DeleteBModelBuffers ();
520521
GL_BuildBModelVertexBuffer ();
521522
GL_BuildBModelMarkBuffers ();
522523
//ericw -- no longer load alias models into a VBO here, it's done in Mod_LoadAliasModel

Quake/r_brush.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,7 @@ void GL_DeleteBModelBuffers (void)
572572
==================
573573
GL_BuildBModelVertexBuffer
574574
575-
Deletes gl_bmodel_vbo if it already exists, then rebuilds it with all
576-
surfaces from world + all brush models
575+
Rebuilds gl_bmodel_vbo with all surfaces from world + all brush models
577576
==================
578577
*/
579578
void GL_BuildBModelVertexBuffer (void)
@@ -585,9 +584,6 @@ void GL_BuildBModelVertexBuffer (void)
585584
float lmscalex = 1.f / 16.f / lightmap_width;
586585
float lmscaley = 1.f / 16.f / lightmap_height;
587586

588-
// ask GL for a name for our VBO
589-
GL_DeleteBuffer (gl_bmodel_vbo);
590-
591587
// count all verts in all models
592588
numverts = 0;
593589
for (j=1 ; j<MAX_MODELS ; j++)

0 commit comments

Comments
 (0)