From: Brian Paul Date: Fri, 30 Jun 2006 15:58:53 +0000 (+0000) Subject: use _mesa_HashDeleteAll() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28930729676fca2a3eebec29660cf4c4b1c5916e;p=mesa.git use _mesa_HashDeleteAll() --- diff --git a/src/mesa/main/occlude.c b/src/mesa/main/occlude.c index 2f4be87901c..0227ebbc7f7 100644 --- a/src/mesa/main/occlude.c +++ b/src/mesa/main/occlude.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.1 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -503,23 +503,24 @@ _mesa_init_query(GLcontext *ctx) } +/** + * Callback for deleting a query object. Called by _mesa_HashDeleteAll(). + */ +static void +delete_queryobj_cb(GLuint id, void *data, void *userData) +{ + struct gl_query_object *q= (struct gl_query_object *) data; + (void) userData; + delete_query_object(q); +} + + /** * Free the context state related to query objects. */ void _mesa_free_query_data(GLcontext *ctx) { - while (1) { - GLuint id = _mesa_HashFirstEntry(ctx->Query.QueryObjects); - if (id) { - struct gl_query_object *q = lookup_query_object(ctx, id); - ASSERT(q); - delete_query_object(q); - _mesa_HashRemove(ctx->Query.QueryObjects, id); - } - else { - break; - } - } + _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, NULL); _mesa_DeleteHashTable(ctx->Query.QueryObjects); }