Browse Source

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 years ago
parent
commit
d16950a2f6
1 changed files with 2 additions and 0 deletions
  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);
 }