printf("FRAME COUNT..: %i frames\n", loop_count);
printf("TIME.........: %3.3f seconds\n", t);
printf("AVERAGE FPS..: %3.3f fps\n", (double)loop_count / t);
+ /* if datap->image is not NULL, this means that */
+ /* we are using the SHM mode */
+ if (datap->image)
+ XCBImageSHMDestroy (datap->image);
XCBDisconnect (datap->conn);
exit(0);
}
}
-/* Return 0 if shm is not availaible, 1 otherwise */
+/* Return 0 if shm is not available, 1 otherwise */
void
shm_test (Data *datap)
{
else
format = 0;
datap->image = XCBImageSHMCreate (datap->conn, datap->depth,
- format, NULL, W_W, W_H);
+ format, NULL, W_W, W_H);
assert(datap->image);
shminfo.shmid = shmget (IPC_PRIVATE,
shminfo.shmid, 0);
shmctl_status = shmctl(shminfo.shmid, IPC_RMID, 0);
assert(shmctl_status != -1);
+ free (rep);
}
if (datap->image)
{
printf ("Usage: lissajoux try_shm\n");
printf (" try_shm == 0: shm not used\n");
- printf (" try_shm != 0: shm is used (if availaible)\n");
+ printf (" try_shm != 0: shm is used (if available)\n");
exit (0);
}
if (argc >= 2)