Просмотр исходного кода

linux-capture: Fix for pipewire capture leaking texture handles

Enter the graphics context before calling gs_texture_destroy() or
else the call will fail causing the texture handles to leak.
Florian Zwoch 3 лет назад
Родитель
Сommit
b6366757c0
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      plugins/linux-capture/pipewire.c

+ 2 - 0
plugins/linux-capture/pipewire.c

@@ -298,8 +298,10 @@ static void destroy_session(obs_pipewire_data *obs_pw)
 	}
 
 	g_clear_pointer(&obs_pw->sender_name, bfree);
+	obs_enter_graphics();
 	g_clear_pointer(&obs_pw->cursor.texture, gs_texture_destroy);
 	g_clear_pointer(&obs_pw->texture, gs_texture_destroy);
+	obs_leave_graphics();
 	g_cancellable_cancel(obs_pw->cancellable);
 	g_clear_object(&obs_pw->cancellable);
 }