glx: Fix drawable private leak on destroy

When a drawable goes away, we don't destroy the GLX drawable in full,
since it may be current for a context.  This means that when the drawable
is destroyed in full later, the backend doesn't get a chance to
destroy resources associated with the drawable (the DRI2Drawable).

With this patch, we destroy the GLX drawable in full when it goes away
and then track down all contexts that reference it and NULL their
pointers.
This commit is contained in:
Kristian Høgsberg
2009-04-09 13:16:37 -04:00
parent 140463a197
commit 7b6400a1b8
10 changed files with 67 additions and 115 deletions

View File

@@ -35,18 +35,11 @@
* Silicon Graphics, Inc.
*/
/* relate contexts with drawables */
extern void __glXAssociateContext(__GLXcontext *glxc);
extern void __glXDeassociateContext(__GLXcontext *glxc);
/* drawable management */
extern void __glXRefDrawable(__GLXdrawable *glxPriv);
extern void __glXUnrefDrawable(__GLXdrawable *glxPriv);
extern GLboolean __glXDrawableInit(__GLXdrawable *drawable,
__GLXscreen *screen,
DrawablePtr pDraw, int type, XID drawID,
__GLXconfig *config);
extern void __glXDrawableRelease(__GLXdrawable *drawable);
/* context helper routines */
extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);