diff options
author | Joey Castillo <jose.castillo@gmail.com> | 2021-10-05 15:55:34 -0400 |
---|---|---|
committer | Joey Castillo <jose.castillo@gmail.com> | 2021-10-05 15:55:34 -0400 |
commit | 8372e37bea5313a131054081e84fe7e9a45f32a9 (patch) | |
tree | 1d23f095e2ecbdd3d6d6af08053f3f6b06e15c97 /launcher/launcher.c | |
parent | 83192b3a580c19eb694ca7951650db87eeb582ad (diff) | |
download | Sensor-Watch-8372e37bea5313a131054081e84fe7e9a45f32a9.tar.gz Sensor-Watch-8372e37bea5313a131054081e84fe7e9a45f32a9.tar.bz2 Sensor-Watch-8372e37bea5313a131054081e84fe7e9a45f32a9.zip |
fix memory leak when waking from screensaver mode
Diffstat (limited to 'launcher/launcher.c')
-rw-r--r-- | launcher/launcher.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/launcher/launcher.c b/launcher/launcher.c index 160b8d2a..7d87c58a 100644 --- a/launcher/launcher.c +++ b/launcher/launcher.c @@ -56,6 +56,14 @@ void app_wake_from_deep_sleep() { } void app_setup() { + static bool is_first_launch = true; + + if (is_first_launch) { + for(uint8_t i = 0; i < LAUNCHER_NUM_WIDGETS; i++) { + widget_contexts[i] = NULL; + is_first_launch = false; + } + } if (launcher_state.screensaver_ticks != -1) { watch_disable_extwake_interrupt(BTN_ALARM); watch_rtc_disable_alarm_callback(); |