forked from FOSS/BangleApps
widcw: fix memory leak
Repeated redrawing would create multiple redraw-timeoutsmaster
parent
489582ee91
commit
ded3b25d3e
|
@ -1 +1,2 @@
|
|||
0.01: First version
|
||||
0.02: Fix memory leak
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "widcw",
|
||||
"name": "Calendar Week Widget",
|
||||
"version": "0.01",
|
||||
"version": "0.02",
|
||||
"description": "Widget which shows the current calendar week",
|
||||
"icon": "widget.png",
|
||||
"type": "widget",
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
}
|
||||
|
||||
// redraw when date changes
|
||||
setTimeout(()=>WIDGETS["widcw"].draw(), (86401 - Math.floor(date/1000) % 86400)*1000);
|
||||
|
||||
if (WIDGETS["widcw"].to) clearTimeout(WIDGETS["widcw"].to);
|
||||
WIDGETS["widcw"].to = setTimeout(()=>WIDGETS["widcw"].draw(), (86401 - Math.floor(date/1000) % 86400)*1000);
|
||||
}
|
||||
|
||||
// add your widget
|
||||
|
|
Loading…
Reference in New Issue