Skip to content

gstreamer: Fix leak using GstBus watch

Frediano Ziglio requested to merge fziglio/spice-gtk:gbus_leak into master

This patch fixes a leak due to not freeing GstBus watch.

The watch is attached (as GSource) to the main loop and retains a pointer to the bus so we need to remove it to release the bus when we release the pipeline.

This was detected forcibly creating and destroying lot of streams. After a while the client program consumed all file descriptors and stopped working. This as GstBus retains a GPoll which, under Unix, uses 2 file descriptors.

For some reasons using gst_pipeline_get_bus again in free_pipeline do not fix entirely the leak so keep a pointer to the exact bus we set our watch on.

Merge request reports

Loading