/* Clears the value of @attr and sets its type to G_FILE_ATTRIBUTE_TYPE_INVALID.  */
void _g_file_attribute_value_clear(GFileAttributeValue *attr)
/* Clears the value of @attr and sets its type to G_FILE_ATTRIBUTE_TYPE_INVALID.  */
void _g_file_attribute_value_clear(GFileAttributeValue *attr)
{
  g_return_if_fail (attr != NULL);
  if (attr->type == G_FILE_ATTRIBUTE_TYPE_STRING ||
      attr->type == G_FILE_ATTRIBUTE_TYPE_BYTE_STRING)
    g_free (attr->u.string);
  if (attr->type == G_FILE_ATTRIBUTE_TYPE_STRINGV)
    g_strfreev (attr->u.stringv);
  if (attr->type == G_FILE_ATTRIBUTE_TYPE_OBJECT &&
      attr->u.obj != NULL)
    g_object_unref (attr->u.obj);
  attr->type = G_FILE_ATTRIBUTE_TYPE_INVALID;
}