add: if (self->destructor) self->destructor(ptr->data);
context: static int removeFromBag(WMBag *self, void *item){    W_Node *ptr = treeFind(SELF->root, SELF->nil, item);        if (ptr != SELF->nil) {	W_Node *tmp;		SELF->count--;		tmp = treeSuccessor(ptr, SELF->nil);	while (tmp != SELF->nil) {	    tmp->index--;	    tmp = treeSuccessor(tmp, SELF->nil);	}		ptr = rbTreeDelete(SELF, ptr);	free(ptr);	return 1;    } else {	return 0;    }}