Skip to content

Commit

Permalink
Remove pthread_exit().
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
imwints committed May 23, 2023
1 parent 37bc27e commit caf781c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/btop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ namespace Runner {
<< Term::sync_end << flush;
}
//* ----------------------------------------------- THREAD LOOP -----------------------------------------------
pthread_exit(NULL);
return {};
}
//? ------------------------------------------ Secondary thread end -----------------------------------------------

Expand Down

0 comments on commit caf781c

Please sign in to comment.