Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: first stab at lvobj memory management #65

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Habbie
Copy link
Member

@Habbie Habbie commented Mar 11, 2024

good news: it looks like we can add this automatic destructor without changing any .cpp

bad news: https://docs.lvgl.io/8.0/overview/object.html says:

There is a common delete function for all object types. It deletes the object and all of its children.

I think this means we need to delete children before we delete parents, and I think this means we should represent LVGL object hierarchy as C++ object hierarchy (which, to be fair, is desirable for a lot of reasons).

@Habbie
Copy link
Member Author

Habbie commented Mar 11, 2024

the destructor should probably take g_lvgl_updatelock, as should our construction (which we currently get away with because we construct everything before we start ticking)

@Habbie
Copy link
Member Author

Habbie commented May 16, 2024

I think this means we need to delete children before we delete parents, and I think this means we should represent LVGL object hierarchy as C++ object hierarchy (which, to be fair, is desirable for a lot of reasons).

via @cyclops1982 in #68 (comment) (and discussed in similar ways on IRC):

"it is okay if only LVGL owns a pointer to this, we currently believe that LVGL will free the object when it is cleaning up the parent"

@Habbie Habbie mentioned this pull request May 16, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant