summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2009-10-07 19:31:21 -0700
committerJamey Sharp <jamey@minilop.net>2009-10-07 19:35:28 -0700
commit956fd30e1046e5779ac0b6c07ec4f0e87250869a (patch)
treeebd9f516db8d0763c3542a95a589ab2869fb73ec /src
parent927e3260bcf1ad020228e8f2dce0176269982b4f (diff)
downloadxorg-lib-libXext-956fd30e1046e5779ac0b6c07ec4f0e87250869a.tar.gz
XAllocID must only be called with the Display lock held.
This patch makes XShmAttach follow the same XID allocation pattern used in other stubs, such as XShmCreatePixmap. Reported-by: <fdsteve@ihug.co.nz> Signed-off-by: Jamey Sharp <jamey@minilop.net>
Diffstat (limited to 'src')
-rw-r--r--src/XShm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/XShm.c b/src/XShm.c
index 922b4cb..38efa9f 100644
--- a/src/XShm.c
+++ b/src/XShm.c
@@ -235,12 +235,11 @@ Status XShmAttach(Display *dpy, XShmSegmentInfo *shminfo)
ShmCheckExtension (dpy, info, 0);
- shminfo->shmseg = XAllocID(dpy);
LockDisplay(dpy);
GetReq(ShmAttach, req);
req->reqType = info->codes->major_opcode;
req->shmReqType = X_ShmAttach;
- req->shmseg = shminfo->shmseg;
+ req->shmseg = shminfo->shmseg = XAllocID(dpy);
req->shmid = shminfo->shmid;
req->readOnly = shminfo->readOnly ? xTrue : xFalse;
UnlockDisplay(dpy);