I need a widget similar to the existing Table widget, but where I can insert/delete rows dynamically.
So I took a look into lv_table.c to see whether I can extend the table widget to do what I need…
I see that there already exists functionality to add rows and/or columns. But memory management when resizing looks somewhat strange to me.
I understand that ext->cell_data is a pointer to a dynamically allocated array of pointers to the cell contents. This array is resized via lv_mem_realloc() when the table gets resized. That’s fine so far.
But what about the pointers to the cell content, which were allocated in lv_table_set_call_value()? Those pointers will be lost when ext->cell_data is shrunken.
This looks like a memory leak to me. Or am I missing something here?