Merge pull request #2064 from rigrig/fix-widcw-memory-leak

widcw: fix memory leak
pull/2069/head
Gordon Williams 2022-07-28 08:43:34 +01:00 committed by GitHub
commit bbe21b129f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -1 +1,2 @@
0.01: First version
0.01: First version
0.02: Fix memory leak

View File

@ -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",

View File

@ -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