-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(snapshot): fix memleak in lv_snapshot #6147
Conversation
Wonderful, thank you! Could you add a test too? Having a screenshot for a transformed layer and an assert for the memory leak would be great. |
31ef039
to
d208639
Compare
OK. By the way, I found |
I've checked it an it seems it really stuck in |
Yes. it's a dead lock problem. |
In the test case, we have three draw task:
For At last, when At this moment, |
d208639
to
051115f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the investigation! I see no issue with running a full dispatching here.
051115f
to
e6587b9
Compare
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
e6587b9
to
36e0f0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
Description of the feature or fix
When we take a snapshot for a lv_obj, if there is a
LV_LAYER_TYPE_TRANSFORM
object in the children.A new layer named
new_layer
will be malloced inrefr_obj
function.But it will not be freed after
lv_snapshot_take_to_buf
done as we calllv_draw_dispatch_layer(NULL, &layer);
Because the
new_layer
is freed only whendisp
is not NULL as the below code.Notes
lv_conf_template.h
run lv_conf_internal_gen.py and update Kconfig.scripts/code-format.py
(astyle version v3.4.12 needs to be installed) and follow the Code Conventions.