summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry (Yu) Song <henry.song@samsung.com>2015-03-05 00:20:42 +0000
committerBryce Harrington <b.harrington@samsung.com>2015-03-05 17:27:14 -0800
commite7fc8f405beeeb1048f69fe22923170a137b805e (patch)
tree31af4e49a600792cdc3d3de30e15304bbd296078
parent4e680ff4bb3a5089b2ec40a96f8e292aa3cfe5f4 (diff)
xlib: Remove queued event from _XReadEvents
Following patch fixes a memory leak in xlib surface. Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
-rw-r--r--src/cairo-xlib-surface-shm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
index fb40699dc..9b4dea5e5 100644
--- a/src/cairo-xlib-surface-shm.c
+++ b/src/cairo-xlib-surface-shm.c
@@ -670,6 +670,7 @@ _cairo_xlib_shm_surface_flush (void *abstract_surface, unsigned flags)
cairo_xlib_shm_surface_t *shm = abstract_surface;
cairo_xlib_display_t *display;
Display *dpy;
+ _XQEvent *qev;
cairo_status_t status;
if (shm->active == 0)
@@ -694,6 +695,10 @@ _cairo_xlib_shm_surface_flush (void *abstract_surface, unsigned flags)
while (! seqno_passed (shm->active, LastKnownRequestProcessed (dpy))) {
LockDisplay(dpy);
_XReadEvents(dpy);
+ while (dpy->head) {
+ qev = dpy->head;
+ _XDeq (dpy, NULL, qev);
+ }
UnlockDisplay(dpy);
}