mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
fix vbo display list memleak upon context destruction
This commit is contained in:
parent
678db26b9d
commit
520a455f55
2 changed files with 16 additions and 0 deletions
|
|
@ -246,6 +246,7 @@ void _vbo_DestroyContext( GLcontext *ctx )
|
|||
}
|
||||
|
||||
vbo_exec_destroy(ctx);
|
||||
vbo_save_destroy(ctx);
|
||||
FREE(vbo_context(ctx));
|
||||
ctx->swtnl_im = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,21 @@ void vbo_save_init( GLcontext *ctx )
|
|||
|
||||
void vbo_save_destroy( GLcontext *ctx )
|
||||
{
|
||||
struct vbo_context *vbo = vbo_context(ctx);
|
||||
struct vbo_save_context *save = &vbo->save;
|
||||
if (save->prim_store) {
|
||||
if ( --save->prim_store->refcount == 0 ) {
|
||||
FREE( save->prim_store );
|
||||
save->prim_store = NULL;
|
||||
}
|
||||
if ( --save->vertex_store->refcount == 0 ) {
|
||||
if (save->vertex_store->bufferobj)
|
||||
ctx->Driver.DeleteBuffer( ctx, save->vertex_store->bufferobj );
|
||||
|
||||
FREE( save->vertex_store );
|
||||
save->vertex_store = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue