[rygel] core: Explicitly remove bus watch



commit cf0097ad816c56328ae19061619cea1a73aa4c6d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Apr 8 21:50:14 2011 +0300

    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 files changed, 3 insertions(+), 1 deletions(-)
---
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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]