Skip to content

Commit

Permalink
xlib: Remove queued event from _XReadEvents
Browse files Browse the repository at this point in the history
Following patch fixes a memory leak in xlib surface.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
  • Loading branch information
Henry (Yu) Song authored and Bryce Harrington committed Mar 6, 2015
1 parent 4e680ff commit e7fc8f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cairo-xlib-surface-shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}

Expand Down

0 comments on commit e7fc8f4

Please sign in to comment.