[rygel] core: Fix endless loop if item disappears



commit e998f0dddaf59f5eb42e9b261580d1f26b300997
Author: Jens Georg <mail jensge org>
Date:   Tue Nov 8 08:41:07 2011 +0100

    core: Fix endless loop if item disappears

 src/rygel/rygel-http-post.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-http-post.vala b/src/rygel/rygel-http-post.vala
index ba60287..51e9cbd 100644
--- a/src/rygel/rygel-http-post.vala
+++ b/src/rygel/rygel-http-post.vala
@@ -120,6 +120,14 @@ internal class Rygel.HTTPPost : HTTPRequest {
                 break;
             }
 
+            // This means that either someone externally has removed the item
+            // or that the back-end decided it's not a shareable item anymore.
+            if (item == null) {
+                warning ("Item %s disappeared, stop waiting for it");
+
+                break;
+            }
+
             if (item.place_holder) {
                 uint source_id = 0;
                 source_id = Timeout.add_seconds (30, () => {



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