Since Cairo does not create the FILE, the caller has to remember it and destroy it anyway. Therefore it should be trivial to also call flush() on it when Cairo is done.