浏览代码

linux-pipewire: Load glad symbols on start

After the cmake 3.0 rebuild glad was transitioned to a static library.
This lead to the glad symbols being uninitialized and crashes when they
are used in some cases.

(cherry picked from commit 5cf0f06669189196f2c1b28c9ccbd56034538f3d)
Kurt Kartaltepe 2 年之前
父节点
当前提交
9f79146a12
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      plugins/linux-pipewire/linux-pipewire.c

+ 5 - 0
plugins/linux-pipewire/linux-pipewire.c

@@ -21,6 +21,7 @@
 
 #include <obs-module.h>
 #include <obs-nix-platform.h>
+#include <glad/glad.h>
 
 #include <pipewire/pipewire.h>
 #include "screencast-portal.h"
@@ -34,6 +35,10 @@ MODULE_EXPORT const char *obs_module_description(void)
 
 bool obs_module_load(void)
 {
+	obs_enter_graphics();
+	gladLoadGL();
+	obs_leave_graphics();
+
 	pw_init(NULL, NULL);
 
 	screencast_portal_load();