/* Remove attribute from hashbin and, if it was the last attribute of the object, remove the object as well.  */
int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib, int cleanobject)
/* Remove attribute from hashbin and, if it was the last attribute of the object, remove the object as well.  */
int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib, int cleanobject)
{
	struct ias_attrib *node;
	IRDA_ASSERT(obj != NULL, return -1;);
	IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -1;);
	IRDA_ASSERT(attrib != NULL, return -1;);
	node = hashbin_remove_this(obj->attribs, (irda_queue_t *) attrib);
	if (!node)
		return 0;
	__irias_delete_attrib(node);
	node = (struct ias_attrib *) hashbin_get_first(obj->attribs);
	if (cleanobject && !node)
		irias_delete_object(obj);
	return 0;
}