瀏覽代碼

Fix static object destructors being called on gpu selection with X11

Abdulrahman Al Zeidi 2 年之前
父節點
當前提交
5860f81c18
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      platform/linuxbsd/x11/detect_prime_x11.cpp

+ 4 - 1
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);
 		}
 	}