Taskbar: thumbnails (XShmGetImage - avoid leaking in X)

This commit is contained in:
o9000
2017-11-16 12:14:09 +01:00
parent 4b50446a7b
commit cbf3cebbb0

View File

@@ -536,6 +536,10 @@ cairo_surface_t *get_window_thumbnail_ximage(Window win, size_t size, gboolean u
// 2nd pass // 2nd pass
smooth_thumbnail(result); smooth_thumbnail(result);
if (ximg) {
XDestroyImage(ximg);
ximg = NULL;
}
err4: err4:
if (use_shm) if (use_shm)
XShmDetach(server.display, &shminfo); XShmDetach(server.display, &shminfo);
@@ -546,7 +550,8 @@ err2:
if (use_shm) if (use_shm)
shmctl(shminfo.shmid, IPC_RMID, NULL); shmctl(shminfo.shmid, IPC_RMID, NULL);
err1: err1:
XDestroyImage(ximg); if (ximg)
XDestroyImage(ximg);
err0: err0:
return result; return result;
} }