-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
E_showMenu: possibly refactor to avoid memory leak by not passing internal menu object l
as argument to callback functions
#2567
Comments
thyttan
added a commit
to thyttan/Espruino
that referenced
this issue
Oct 10, 2024
This removes a potential for memory leaks and should otherwise have no impact. As no app on the main BangleApps repo seems to use the option. See espruino#2567.
thyttan
added a commit
to thyttan/Espruino
that referenced
this issue
Oct 10, 2024
This removes a potential for memory leaks and should otherwise have no impact. As no app on the main BangleApps repo seems to use the option. See espruino#2567. closes espruino#2567
Checking for use of the passed argument
|
thyttan
changed the title
E_showMenu_Q3: possibly refactor to avoid memory leak by not passing scroller as argument to callback functions
E_showMenu_Q3: possibly refactor to avoid memory leak by not passing internal menu object Oct 10, 2024
l
as argument to callback functions
thyttan
changed the title
E_showMenu_Q3: possibly refactor to avoid memory leak by not passing internal menu object
E_showMenu: possibly refactor to avoid memory leak by not passing internal menu object Oct 10, 2024
l
as argument to callback functionsl
as argument to callback functions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background
Originally posted by @gfwilliams in #2565 (comment)
Commenting on this:
I did some digging below.
Conclusions based on findings below
The software reference needs updating regarding the contents of the returned object - as it seems to correspond to an older implementation.Edit: I see, for Bangle.js 1 it's stilldraw
,select
andmove
(+back
andlastIdx
).The custom implementations may need updates to their respective readme's to indicate the returned object does not match the current firmware implementation.Method
Grep for
E\.showMenu
over all files in BangleApps.Grep again over the files from (1.) with
(\.scroller)|(\.draw\(\))
.Copy matches to quickfix list for inspection, resulting in findings below.
E.showMenu
were omitted from findings sections below.Apps using the object from
E.showMenu
Summary
No app seem to use the option to look at the scroller object as a parameter to any of the entry mapped callback functions.
Findings per app
Apps that replace
E.showMenu
with their own imlementation.Summary
There are inconsistencies between the returned objects constitution of the standard and custom implementations(Edit: It's that they correspond more to the Bangle.js 1 standard implementations).The custom implementations mostly contain
draw
,select
andmove
entries. But also e.g.info
,scroll
,selected
,lastIdx
. They most often return the object as well as send it as an argument to the callback functions.The standard implementation contains
draw
andscroller
(Edit: For Bangle.js 2):Findings per app
The text was updated successfully, but these errors were encountered: