From 5860f81c18a2de8b3f38d5a58946939b5cc81425 Mon Sep 17 00:00:00 2001 From: Abdulrahman Al Zeidi Date: Mon, 7 Nov 2022 09:27:24 +0000 Subject: Fix static object destructors being called on gpu selection with X11 --- platform/linuxbsd/x11/detect_prime_x11.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/linuxbsd/x11/detect_prime_x11.cpp b/platform/linuxbsd/x11/detect_prime_x11.cpp index fb833ab5e6..78a10fa2b0 100644 --- a/platform/linuxbsd/x11/detect_prime_x11.cpp +++ b/platform/linuxbsd/x11/detect_prime_x11.cpp @@ -208,7 +208,10 @@ int detect_prime() { print_verbose("Couldn't write vendor/renderer string."); } close(fdset[1]); - exit(0); + + // The function quick_exit() is used because exit() will call destructors on static objects copied by fork(). + // These objects will be freed anyway when the process finishes execution. + quick_exit(0); } } -- cgit v1.2.3