diff options
author | Kristian Høgsberg <[email protected]> | 2007-05-11 13:24:34 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2007-10-10 17:09:36 -0400 |
commit | 9590ba97ad6606a96b50a66242f606c860ca239d (patch) | |
tree | 89635762d0514244eccc95c3ca95bbbc0fac758f | |
parent | 8ed5c7ca0572a09375bdfd411c3804456dac78d6 (diff) |
Avoid deadlock in GarbageCollectDRIDrawables.
__glXinitialize() can't be called with the GLX lock held. Just
pass in the __GLXscreenConfigs pointer so we don't have to look it
up in __GLXdisplayPrivate.
-rw-r--r-- | src/glx/x11/glxcmds.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index b6c0c763e3b..75790c977ee 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -80,24 +80,18 @@ static int windowExistsErrorHandler(Display *dpy, XErrorEvent *xerr) * \param dpy Display to destroy drawables for * \param screen Screen number to destroy drawables for */ -static void GarbageCollectDRIDrawables(Display *dpy, int screen) +static void GarbageCollectDRIDrawables(Display *dpy, __GLXscreenConfigs *sc) { - __GLXdisplayPrivate * const priv = __glXInitialize(dpy); - __GLXscreenConfigs *sc; __DRIid draw; __GLXdrawable *pdraw; XWindowAttributes xwa; int (*oldXErrorHandler)(Display *, XErrorEvent *); - if (priv == NULL || priv->driDisplay.private == NULL) - return; - /* Set no-op error handler so Xlib doesn't bail out if the windows * has alreay been destroyed on the server. */ XSync(dpy, GL_FALSE); oldXErrorHandler = XSetErrorHandler(windowExistsErrorHandler); - sc = &priv->screenConfigs[screen]; if (__glxHashFirst(sc->drawHash, &draw, (void *)&pdraw) == 1) { do { windowExistsFlag = GL_TRUE; @@ -540,7 +534,7 @@ DestroyContext(Display *dpy, GLXContext gc) XF86DRIDestroyContext(dpy, gc->psc->scr, gc->hwContextID); gc->driContext.private = NULL; } - GarbageCollectDRIDrawables(dpy, gc->screen); + GarbageCollectDRIDrawables(dpy, gc->psc); } #endif |