cairo_surface_finish() does not cause cairo_surface_status() to return CAIRO_STATUS_SURFACE_FINISHED
See example below. Without this there seems to be no way to check if a surface is still usable or was finished in the meantime.
#include <cairo/cairo.h>
#include <stdio.h>
#include <stdint.h>
int main(int argc, char ** argv) {
cairo_surface_t * surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1024, 1024);
// prints "0"
printf("status before: %d\n", cairo_surface_status(surf));
uint8_t *data = cairo_image_surface_get_data(surf);
// works
data[0] = 1;
cairo_surface_finish(surf);
// still prints "0"
printf("status after: %d\n", cairo_surface_status(surf));
data = cairo_image_surface_get_data(surf);
// segfault because memory was freed
data[0] = 1;
cairo_surface_destroy(surf);
return 0;
}