diff options
author | Brian Paul <[email protected]> | 2006-06-30 15:58:53 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-06-30 15:58:53 +0000 |
commit | 28930729676fca2a3eebec29660cf4c4b1c5916e (patch) | |
tree | 1079172f53a2e4469e6d0dd6ad654654ea6d6905 /src/mesa/main | |
parent | 66c9be06f963f23fb1d158dcf3df737521a16d0f (diff) |
use _mesa_HashDeleteAll()
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/occlude.c | 29 |
1 files changed, 15 insertions, 14 deletions
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"), @@ -504,22 +504,23 @@ _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); } |