/* Remove and free all elements from a linked list. The list remain valid but become empty.  */
void _lv_ll_clear(lv_ll_t *ll_p)
/* Remove and free all elements from a linked list. The list remain valid but become empty.  */
void _lv_ll_clear(lv_ll_t *ll_p)
{
    void * i;
    void * i_next;
    i      = _lv_ll_get_head(ll_p);
    i_next = NULL;
    while(i != NULL) {
        i_next = _lv_ll_get_next(ll_p, i);
        _lv_ll_remove(ll_p, i);
        lv_mem_free(i);
        i = i_next;
    }
}