Преглед изворни кода

libobs/util: Prevent locking mutex in child process when checking Qt5

The frontend has set a log handler which locks the mutex in `LogString`.
If `os_dlopen` fails in the child process, it calls `blog` and attempted
to lock the mutex that may have already been locked by another thread
before `fork()`. This change prevents the child process from locking the
mutex, resolving the potential deadlock.
Norihiro Kamae пре 6 месеци
родитељ
комит
5c448452cf
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      libobs/util/platform-nix.c

+ 1 - 0
libobs/util/platform-nix.c

@@ -134,6 +134,7 @@ bool has_qt5_dependency(const char *path)
 {
 	pid_t pid = fork();
 	if (pid == 0) {
+		base_set_log_handler(NULL, NULL);
 		_exit(module_has_qt5_check(path));
 	}
 	if (pid < 0) {