mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
grid: add new function, grid_row_reset_extra()
This function resets (free:s) all ‘extra’ data associated with a row.
This commit is contained in:
parent
0e6b1f7508
commit
00977fcc15
1 changed files with 15 additions and 0 deletions
15
grid.h
15
grid.h
|
|
@ -72,3 +72,18 @@ grid_row_in_view(struct grid *grid, int row_no)
|
||||||
xassert(row != NULL);
|
xassert(row != NULL);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
grid_row_reset_extra(struct row *row)
|
||||||
|
{
|
||||||
|
if (likely(row->extra == NULL))
|
||||||
|
return;
|
||||||
|
|
||||||
|
tll_foreach(row->extra->uri_ranges, it) {
|
||||||
|
free(it->item.uri);
|
||||||
|
tll_remove(row->extra->uri_ranges, it);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(row->extra);
|
||||||
|
row->extra = NULL;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue