Sfoglia il codice sorgente

linux-pipewire: Cleanup D-Bus proxy on unload

When the linux-pipewire plugin is unloaded, make sure to cleanup
the D-Bus proxy for the ScreenCast portal too. This effectively
doesn't change anything, but it's always good to keep up with the
code hygiene.
Georges Basile Stavracas Neto 3 anni fa
parent
commit
874c30cb88

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

@@ -43,6 +43,8 @@ bool obs_module_load(void)
 
 void obs_module_unload(void)
 {
+	screencast_portal_unload();
+
 #if PW_CHECK_VERSION(0, 3, 49)
 	pw_deinit();
 #endif

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

@@ -880,3 +880,8 @@ void screencast_portal_load(void)
 	if (window_capture_available)
 		obs_register_source(&screencast_portal_window_capture_info);
 }
+
+void screencast_portal_unload(void)
+{
+	g_clear_object(&screencast_proxy);
+}

+ 1 - 0
plugins/linux-pipewire/screencast-portal.h

@@ -21,3 +21,4 @@
 #pragma once
 
 void screencast_portal_load(void);
+void screencast_portal_unload(void);