From 088806550b7dbf66dda2fd2492a3921c9fbb5be5 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 26 Aug 2025 16:43:19 -0400 Subject: [PATCH] textviewer: Workaround for musl libc musl doesn't unload shared objects when we dlclose() the handle. This means it also never re-initializes them if we try to re-launch. This means that global state is persisted across invocations instead of being wiped. Until we come up with a proper workaround we can apply globally, have the textviewer clean up the important global state when it exits. Change-Id: I43bf38e6e9f0e7d824931740daff6c060537235a --- apps/plugins/text_viewer/tv_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/plugins/text_viewer/tv_display.c b/apps/plugins/text_viewer/tv_display.c index 9eb1151672..73be39b288 100644 --- a/apps/plugins/text_viewer/tv_display.c +++ b/apps/plugins/text_viewer/tv_display.c @@ -360,8 +360,10 @@ void tv_finalize_display(void) } /* undo viewport */ - if (is_initialized_vp) + if (is_initialized_vp) { rb->viewportmanager_theme_undo(SCREEN_MAIN, false); + is_initialized_vp = false; // Workaround for musl libc + } } bool tv_exist_scrollbar(void)