summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-13 19:15:08 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-13 19:30:54 +0100
commit79b4e45ebe3a61f9b5937ad226eead9eebce87ac (patch)
tree6df6f573f3f9038a027c8b84389effc38db11aaa
parentc8074b6bcfa8c208433574721135faa4d919d32a (diff)
intel-virtual-output: Only call XShmDetach on a valid SHM segment
Saves a couple of extraneous XErrors. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tools/virtual.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index 4b1c9684..0d54393b 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1091,12 +1091,12 @@ static int clone_init_xfer(struct clone *clone)
DisplayString(clone->dst.dpy), clone->dst.name,
width, height));
- if (clone->src.use_shm)
- XShmDetach(clone->src.dpy, &clone->src.shm);
- if (clone->dst.use_shm)
- XShmDetach(clone->dst.dpy, &clone->dst.shm);
-
if (clone->shm.shmaddr) {
+ if (clone->src.use_shm)
+ XShmDetach(clone->src.dpy, &clone->src.shm);
+ if (clone->dst.use_shm)
+ XShmDetach(clone->dst.dpy, &clone->dst.shm);
+
shmdt(clone->shm.shmaddr);
clone->shm.shmaddr = NULL;
}