rem: XSync(context->dpy, False);
context: RDestroyXImage(RContext *context, RXImage *rximage){#ifndef XSHM    XDestroyImage(rximage->image);#else /* XSHM */    if (rximage->is_shared) {	XSync(context->dpy, False);	XShmDetach(context->dpy, &rximage->info);	XDestroyImage(rximage->image);	if (shmdt(rximage->info.shmaddr) < 0)	    perror("wrlib:shmdt:");	if (shmctl(rximage->info.shmid, IPC_RMID, 0) < 0)	    perror("wrlib:shmctl:");    } else {	XDestroyImage(rximage->image);    }#endif    free(rximage);}