From 175ec1201d7974db9cb7ad54bbab949a3571834c Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Thu, 18 Feb 2010 16:54:58 +0200 Subject: [PATCH] core: ContentDirectory keeps a list of active imports --- src/rygel/rygel-content-directory.vala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/rygel/rygel-content-directory.vala b/src/rygel/rygel-content-directory.vala index 8718c8d..902bb97 100644 --- a/src/rygel/rygel-content-directory.vala +++ b/src/rygel/rygel-content-directory.vala @@ -57,6 +57,8 @@ public class Rygel.ContentDirectory: Service { public MediaContainer root_container; private ArrayList updated_containers; + private ArrayList active_imports; + private bool clear_updated_containers; private uint update_notify_id; @@ -84,6 +86,7 @@ public class Rygel.ContentDirectory: Service { } this.updated_containers = new ArrayList (); + this.active_imports = new ArrayList (); this.root_container.container_updated += on_container_updated; @@ -161,9 +164,22 @@ public class Rygel.ContentDirectory: Service { owned ServiceAction action) { var import = new ImportResource (this, action); + import.completed += this.on_import_completed; + this.active_imports.add (import); + import.run.begin (); } + private void on_import_completed (ImportResource import) { + // According to CDS specs (v3 section 2.4.17), we must not immediately + // remove the import from out memory + Timeout.add_seconds (30, () => { + this.active_imports.remove (import); + + return false; + }); + } + /* GetSystemUpdateID action implementation */ private void get_system_update_id_cb (ContentDirectory content_dir, owned ServiceAction action) { -- 2.7.4