From a5e4969d7e6109da8241f04db8ef2fc626c4559d Mon Sep 17 00:00:00 2001 From: zackiloco Date: Thu, 25 May 2023 22:40:55 +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 1ec2a10..552adae 100644 --- a/src/btop.cpp +++ b/src/btop.cpp @@ -657,7 +657,7 @@ namespace Runner { << Term::sync_end << flush; } //* ----------------------------------------------- THREAD LOOP ----------------------------------------------- - pthread_exit(NULL); + return {}; } //? ------------------------------------------ Secondary thread end -----------------------------------------------