If you happen to register an atexit() handler in your code that calls
glXDestroyContext(), and then you create a context, FX-Mesa will then
register an atexit() handler itself. When your program exits, the
FX-Mesa handler is called first, it brute force deletes the context,
and then your call in glXDestroyContext() causes memory corruption
because it doesn't know that the context has been freed already. This
is bad.

It would seem the trivial solution is to guard the actual deletion in
fxMesaDestroyContext() with an if( glbTotNumCtx ) { } after the ref
count decrement. I can submit a patch to do this if necessary.

Also, is it just me or is the glbTotNumCtx=1 line in cleangraphics() a
little unsafe? Does the FX driver implicitly reject the notion of
multiple contexts?

m.

-- 
Programmer                         "I wrote a song about dental floss,
Loki Entertainment Software         but did anyone's teeth get cleaner?"
http://lokigames.com/~briareos/              - Frank Zappa, re: the PMRC


_______________________________________________
Mesa-dev maillist  -  [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev

Reply via email to