From caf781c987fefdc6b08c4e21ff7ceda1a11d67e7 Mon Sep 17 00:00:00 2001 From: zackiloco Date: Tue, 23 May 2023 18:44:53 +0200 Subject: [PATCH] Remove `pthread_exit()`. Returning from the thread this way prevents local variables to be destructed correctly since pthread_exit is marked noreturn. This fixes a segmentation fault with glibc and llvm-libunwind on exit. --- src/btop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/btop.cpp b/src/btop.cpp index 11b874d2f..6df238d78 100644 --- a/src/btop.cpp +++ b/src/btop.cpp @@ -611,7 +611,7 @@ namespace Runner { << Term::sync_end << flush; } //* ----------------------------------------------- THREAD LOOP ----------------------------------------------- - pthread_exit(NULL); + return {}; } //? ------------------------------------------ Secondary thread end -----------------------------------------------