Skip to content

egl-gles: Close dma-buf FDs after import

Scott Anderson requested to merge ascent/kms-quads:dma-buf-fd-leak into master

Fixes #1 (closed)

This fixes a file descriptor leak for every buffer we make.

/proc/$pid/fd/ before:

lrwx------ 1 scott scott 64 Apr 23 14:54 0 -> /dev/tty2
lrwx------ 1 scott scott 64 Apr 23 14:54 1 -> /dev/tty2
lr-x------ 1 scott scott 64 Apr 23 14:54 12 -> anon_inode:sync_file
lr-x------ 1 scott scott 64 Apr 23 14:54 13 -> anon_inode:sync_file
lrwx------ 1 scott scott 64 Apr 23 14:54 2 -> /dev/tty2
lrwx------ 1 scott scott 64 Apr 23 14:54 3 -> /dev/dri/card0
lrwx------ 1 scott scott 64 Apr 23 14:54 4 -> /dev/dri/card0
lrwx------ 1 scott scott 64 Apr 23 14:54 5 -> /dev/tty2
lrwx------ 1 scott scott 64 Apr 23 14:54 6 -> anon_inode:dmabuf
lrwx------ 1 scott scott 64 Apr 23 14:54 7 -> anon_inode:dmabuf
lrwx------ 1 scott scott 64 Apr 23 14:54 8 -> anon_inode:dmabuf
lr-x------ 1 scott scott 64 Apr 23 14:54 9 -> anon_inode:sync_file

/proc/$pid/fd/ after:

lrwx------ 1 scott scott 64 Apr 23 15:17 0 -> /dev/tty2
lrwx------ 1 scott scott 64 Apr 23 15:17 1 -> /dev/tty2
lr-x------ 1 scott scott 64 Apr 23 15:17 10 -> anon_inode:sync_file
lrwx------ 1 scott scott 64 Apr 23 15:17 2 -> /dev/tty2
lrwx------ 1 scott scott 64 Apr 23 15:17 3 -> /dev/dri/card0
lrwx------ 1 scott scott 64 Apr 23 15:17 4 -> /dev/dri/card0
lrwx------ 1 scott scott 64 Apr 23 15:17 5 -> /dev/tty2
lr-x------ 1 scott scott 64 Apr 23 15:17 6 -> anon_inode:sync_file
lr-x------ 1 scott scott 64 Apr 23 15:17 9 -> anon_inode:sync_file

Merge request reports