From 7f638e54eeee25399c38d404882e1c943626c36a Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 7 Apr 2021 10:48:49 -0400 Subject: [PATCH] RFC: Fix a couple more dangling stack-allocated viewports They could end up getting referenced after the stack has been popped. Change-Id: I12abbf3f436ecfde76a37f2623a044915800d2b2 --- apps/gui/pitchscreen.c | 8 ++++++++ apps/recorder/recording.c | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/gui/pitchscreen.c b/apps/gui/pitchscreen.c index a6e6e42c43..871921a10f 100644 --- a/apps/gui/pitchscreen.c +++ b/apps/gui/pitchscreen.c @@ -1062,7 +1062,15 @@ int gui_syncpitchscreen_run(void) new_speed = 0; } } + pcmbuf_set_low_latency(false); pop_current_activity(); + + /* Clean up */ + FOR_NB_SCREENS(i) + { + screens[i].set_viewport(NULL); + } + return 0; } diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 36331a72f3..bf69e8f781 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -1084,7 +1084,7 @@ bool recording_screen(bool no_source) pm_y[i] = font_get(vp_top[i].font)->height * 2; trig_ypos[i] = font_get(vp_top[i].font)->height * 3; if(compact_view[i]) - trig_ypos[i] -= (font_get(vp_top[i].font)->height)/2; + trig_ypos[i] -= (font_get(vp_top[i].font)->height)/2; } /* init the bottom list */ @@ -1803,8 +1803,10 @@ rec_abort: rec_status &= ~RCSTAT_IN_RECSCREEN; sound_settings_apply(); - FOR_NB_SCREENS(i) + FOR_NB_SCREENS(i) { + screens[i].set_viewport(NULL); screens[i].setfont(FONT_UI); + } /* if the directory was created or recording happened, make sure the browser is updated */