[TerminalClock] Attempt to fix memoryleak with fastloading

pull/2582/head
Stiralbios 2023-02-15 18:29:16 +01:00
parent 716af7c18b
commit d493a305e2
3 changed files with 5 additions and 3 deletions

View File

@ -8,3 +8,4 @@
0.08: Hide widgets instead of not loading them at all
Use Clockface_menu for widgets and power saving settings
0.09: Add default HRM value, default altitude value
0.10: Add fastloading

View File

@ -78,7 +78,7 @@
});
},
/*
// todo add fastloading when the memory leak is fixed
remove: function() {
if (this.turnOnInterval){
@ -87,13 +87,13 @@
}
if (this.turnOffServiceTimeout){
clearTimeout(this.turnOffServiceTimeout)
delete this.turnOffServiceTimeout
}
turnOffServices();
if (this.onLock) Bangle.removeListener('lock', this.onLock);
if (this.onHRM) Bangle.removeListener('HRM', this.onHRM);
if (this.onPressure) Bangle.removeListener('onPressure', this.onPressure);
}
*/
});
@ -173,6 +173,7 @@
Bangle.setBarometerPower(true, "terminalclock");
}
if(clock.powerSave){
delete clock.turnOffServiceTimeout;
clock.turnOffServiceTimeout = setTimeout(function () {
turnOffServices();
}, 45000);

View File

@ -3,7 +3,7 @@
"name": "Terminal Clock",
"shortName":"Terminal Clock",
"description": "A terminal cli like clock displaying multiple sensor data",
"version":"0.09",
"version":"0.10",
"icon": "app.png",
"type": "clock",
"tags": "clock",