/* Destroys all current keys in the user data array and deallocates any memory allocated for the array itself.  */
void _cairo_user_data_array_fini(cairo_user_data_array_t *array)
/* Destroys all current keys in the user data array and deallocates any memory allocated for the array itself.  */
void _cairo_user_data_array_fini(cairo_user_data_array_t *array)
{
    unsigned int num_slots;
    num_slots = array->num_elements;
    if (num_slots) {
	cairo_user_data_slot_t *slots;
	slots = _cairo_array_index (array, 0);
	while (num_slots--) {
	    cairo_user_data_slot_t *s = &slots[num_slots];
	    if (s->user_data != NULL && s->destroy != NULL)
		s->destroy (s->user_data);
	}
    }
    _cairo_array_fini (array);
}