From 595c62862cab37fda83d0bf31e8309c907fe13d6 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Wed, 18 Jan 2012 17:37:47 +0100 Subject: [PATCH] external: Don't crash on hierarchical update If a MediaServer2 provider sends an update for /foo/bar/baz and /foo/bar chances are that the update for /foo/bar invalidates the parent pointer in /foo/bar/baz causing a crash of various sorts. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=759206 --- src/plugins/external/rygel-external-container.vala | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/external/rygel-external-container.vala b/src/plugins/external/rygel-external-container.vala index 2df9f0c..e789997 100644 --- a/src/plugins/external/rygel-external-container.vala +++ b/src/plugins/external/rygel-external-container.vala @@ -63,6 +63,15 @@ public class Rygel.External.Container : Rygel.MediaContainer, DBusProxyFlags.DO_NOT_LOAD_PROPERTIES); this.update_container.begin (true); + if (parent != null) { + parent.add_weak_pointer (&this.parent); + } + } + + ~Container() { + if (this.parent != null) { + this.parent.remove_weak_pointer (&this.parent); + } } public override async MediaObjects? get_children (uint offset, -- 2.7.4