diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c index 170f34043..4f3d821ef 100644 --- a/src/backends/meta-screen-cast-stream-src.c +++ b/src/backends/meta-screen-cast-stream-src.c @@ -885,7 +885,7 @@ create_pipewire_source (void) pipewire_source->pipewire_loop = pw_loop_new (NULL); if (!pipewire_source->pipewire_loop) { - g_source_destroy ((GSource *) pipewire_source); + g_source_unref ((GSource *) pipewire_source); return NULL; } @@ -980,6 +980,7 @@ meta_screen_cast_stream_src_finalize (GObject *object) g_clear_pointer (&priv->pipewire_core, pw_core_disconnect); g_clear_pointer (&priv->pipewire_context, pw_context_destroy); g_source_destroy (&priv->pipewire_source->base); + g_source_unref (&priv->pipewire_source->base); G_OBJECT_CLASS (meta_screen_cast_stream_src_parent_class)->finalize (object); }