core: Always disconnect handler
authorJens Georg <mail@jensge.org>
Fri, 18 Nov 2011 08:55:40 +0000 (09:55 +0100)
committerJens Georg <mail@jensge.org>
Fri, 23 Dec 2011 17:25:06 +0000 (18:25 +0100)
Prevents reference leaks on the container searched in.

src/rygel/rygel-simple-container.vala

index 79fcafd..4b82bb4 100644 (file)
@@ -162,6 +162,10 @@ public class Rygel.SimpleContainer : Rygel.MediaContainer,
                     var container = child as MediaContainer;
                     media_object = yield container.find_object (id, cancellable);
 
+                    if (updated_id != 0) {
+                        this.disconnect (updated_id);
+                    }
+
                     if (media_object != null) {
                         // no need to loop when we've found what we were looking
                         // for
@@ -173,10 +177,6 @@ public class Rygel.SimpleContainer : Rygel.MediaContainer,
                     if (restart) {
                         break;
                     }
-
-                    if (updated_id != 0) {
-                        this.disconnect (updated_id);
-                    }
                 }
             }
         } while (restart && restart_count < 10);