[Mesa-dev] [PATCH 04/14] mesa: Fix _mesa_problem() on context destroy after application debug output

Eric Anholt eric at anholt.net
Tue Mar 5 13:27:26 PST 2013


Jordan Justen <jljusten at gmail.com> writes:

> On Fri, Feb 22, 2013 at 7:52 PM, Eric Anholt <eric at anholt.net> wrote:
>> This was apparently not noticed because we don't have any testing of
>> application-generated debug output.  However, as I'm changing the
>> GL-generated debug output to use the same path as
>> application/middleware-generated debug output, this obviously became an
>> issue.
>> ---
>>  src/mesa/main/errors.c |    6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
>> index 3714067..6adc466 100644
>> --- a/src/mesa/main/errors.c
>> +++ b/src/mesa/main/errors.c
>> @@ -756,6 +756,11 @@ _mesa_init_errors(struct gl_context *ctx)
>>        }
>>  }
>>
>> +static void
>> +do_nothing(GLuint key, void *data, void *userData)
>> +{
>> +}
>> +
>>  void
>>  _mesa_free_errors_data(struct gl_context *ctx)
>>  {
>> @@ -765,6 +770,7 @@ _mesa_free_errors_data(struct gl_context *ctx)
>>     /* Tear down state for filtering client-provided debug messages. */
>>     for (s = 0; s < SOURCE_COUNT; s++)
>>        for (t = 0; t < MESA_DEBUG_TYPE_COUNT; t++) {
>> +         _mesa_HashDeleteAll(ClientIDs->Namespaces[s][t].IDs, do_nothing, NULL);
>
> Maybe _mesa_HashDeleteAll should accept a NULL callback routine?

Given that we're working around the _mesa_problem() for the expected
usage of this hash table wrapper (GL handles to GL object pointers), I
think we should swap to directly using the underlying hash table, which
wouldn't have this problem, and would remove the ID==0 special case
code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130305/63ec17cc/attachment.pgp>


More information about the mesa-dev mailing list