Should I remove event callback(s) from an object before I delete it?


I would like to clean a screen in order to save some memory for new widgets. As I saw in the library source code (lv_event.c) every event callback use dynamic memory allocation and stored in the heap (which makes sense because maybe you want to add multiple callbacks to an object). But it seems that this piece of allocated memory only be freed by lv_obj_remove_event_cb(). So it means if I delete an object with event callback, the memory allocated by event will not be freed? Or LVGL handle this issue automatically?

What LVGL version are you using?


What do you want to achieve?

I want to avoid memory leaks.