From 5ee0aa1de9006fef2eea65b8f84d512c22775aec Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 10 Jul 2020 01:08:56 -0700 Subject: get_frame: perform shmctl(IPC_RMID) after shmat() No need to duplicate this down at the teardown, it won't go away with outstanding references so you can basically queue the rm. --- recordmydesktop/src/rmd_get_frame.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'recordmydesktop/src/rmd_get_frame.c') diff --git a/recordmydesktop/src/rmd_get_frame.c b/recordmydesktop/src/rmd_get_frame.c index d186f95..4018d3d 100644 --- a/recordmydesktop/src/rmd_get_frame.c +++ b/recordmydesktop/src/rmd_get_frame.c @@ -154,6 +154,7 @@ static int rmdFirstFrame(ProgData *pdata, Image *image) { image->shm_info.shmaddr = image->ximage->data = shmat(image->shm_info.shmid, NULL, 0); image->shm_info.readOnly = False; + shmctl(image->shm_info.shmid, IPC_RMID, NULL); if (!XShmAttach(pdata->dpy, &image->shm_info)) { fprintf(stderr, "Failed to attach shared memory to proccess.\n"); @@ -582,11 +583,9 @@ void *rmdGetFrame(ProgData *pdata) { if (!pdata->args.noshared) { XShmDetach(pdata->dpy, &image.shm_info); shmdt(image.shm_info.shmaddr); - shmctl(image.shm_info.shmid, IPC_RMID, 0); if (d_buff) { XShmDetach(pdata->dpy, &image_back.shm_info); shmdt(image_back.shm_info.shmaddr); - shmctl(image_back.shm_info.shmid, IPC_RMID, 0); } } -- cgit v1.2.3