From: Zeeshan Ali (Khattak) Date: Thu, 18 Feb 2010 14:54:58 +0000 (+0200) Subject: core: ContentDirectory keeps a list of active imports X-Git-Tag: RYGEL_0_5_0~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=175ec1201d7974db9cb7ad54bbab949a3571834c;p=profile%2Fivi%2Frygel.git core: ContentDirectory keeps a list of active imports --- 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) {