Skip to content

Commit a49add7

Browse files
committed
E_showMenu_F18/Q3: rm internal l as cb func arg
Remove internal menu object `l` as argument to callback function. 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
1 parent 133933b commit a49add7

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
removeListener while executing events no longer stops subsequent listeners from executing (#2151)
3939
jsvObjectIterator is now safe even if not called on something iterable
4040
X.on now always allocates an array - tidies up code (fix #2559)
41+
Bangle.js: E.showMenu no longer sends the internal `l` menu object as argument when running the callback function.
4142

4243
2v24 : Bangle.js2: Add 'Bangle.touchRd()', 'Bangle.touchWr()'
4344
Bangle.js2: After Bangle.showTestScreen, put Bangle.js into a hard off state (not soft off)

libs/js/banglejs/E_showMenu_F18.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
item.onchange(item.value);
143143
l.draw(options.selected, options.selected);
144144
}
145-
} else if ("function" == typeof item) item(l);
145+
} else if ("function" == typeof item) item();
146146
else if ("object" == typeof item) {
147147
// if a number, go into 'edit mode'
148148
if ("number" == typeof item.value) {
@@ -198,4 +198,4 @@
198198
};
199199
l.draw();
200200
return l;
201-
})
201+
})

libs/js/banglejs/E_showMenu_F18.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/js/banglejs/E_showMenu_Q3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
if (idx<0) return back&&back(); // title
138138
var item = menu[keys[idx]];
139139
Bangle.buzz(20);
140-
if ("function" == typeof item) item(l);
140+
if ("function" == typeof item) item();
141141
else if ("object" == typeof item) {
142142
// if a bool, just toggle it
143143
if ("number" == typeof item.value) {

libs/js/banglejs/E_showMenu_Q3.min.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)