summaryrefslogtreecommitdiff
path: root/recordmydesktop/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-07-10 01:08:56 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-07-11 13:36:42 -0700
commit5ee0aa1de9006fef2eea65b8f84d512c22775aec (patch)
treecffdf18ea04b2e7cc7e9641e804a4c895180f8be /recordmydesktop/src
parent6ff81d0947a68fa5432c88a08bb9842c71c81489 (diff)
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.
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r--recordmydesktop/src/rmd_get_frame.c3
1 files changed, 1 insertions, 2 deletions
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);
}
}
© All Rights Reserved