From: Brian Paul Date: Fri, 25 Jun 2004 14:46:48 +0000 (+0000) Subject: remove program from hash table when deleted (bug 979514) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c9a415663ad92a703b5b1e1e70cd41727114b760;p=mesa.git remove program from hash table when deleted (bug 979514) --- diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index b58b5e003d2..8dc6ecb7421 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -974,14 +974,13 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids) ctx->Driver.DeleteProgram(ctx, prog); } } - else { - /* This is necessary as we can't tell from HashLookup - * whether the entry exists with data == 0, or if it - * doesn't exist at all. As GenPrograms creates the first - * case below, need to call Remove() to avoid memory leak: - */ - _mesa_HashRemove(ctx->Shared->Programs, ids[i]); - } + /* Always remove entry from hash table. + * This is necessary as we can't tell from HashLookup + * whether the entry exists with data == 0, or if it + * doesn't exist at all. As GenPrograms creates the first + * case below, need to call Remove() to avoid memory leak: + */ + _mesa_HashRemove(ctx->Shared->Programs, ids[i]); } } }