From cf0097ad816c56328ae19061619cea1a73aa4c6d Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Fri, 8 Apr 2011 21:50:14 +0300 Subject: [PATCH] core: Explicitly remove bus watch We need to do this to break cyclic reference between HTTPGstResponse, GstPipeline and GstBus. --- src/rygel/rygel-http-gst-response.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rygel/rygel-http-gst-response.vala b/src/rygel/rygel-http-gst-response.vala index df48838..5ef6539 100644 --- a/src/rygel/rygel-http-gst-response.vala +++ b/src/rygel/rygel-http-gst-response.vala @@ -27,6 +27,7 @@ using Soup; internal class Rygel.HTTPGstResponse : Rygel.HTTPResponse { private Pipeline pipeline; + private uint bus_watch_id; public HTTPSeek seek; @@ -66,6 +67,7 @@ internal class Rygel.HTTPGstResponse : Rygel.HTTPResponse { sink.cancellable.cancel (); this.pipeline.set_state (State.NULL); + Source.remove (this.bus_watch_id); var encoding = this.msg.response_headers.get_encoding (); @@ -100,7 +102,7 @@ internal class Rygel.HTTPGstResponse : Rygel.HTTPResponse { // Bus handler var bus = this.pipeline.get_bus (); - bus.add_watch (bus_handler); + this.bus_watch_id = bus.add_watch (this.bus_handler); } private void src_pad_added (Element src, -- 2.7.4