[rygel/rygel-0-12] external: Don't crash on hierarchical update
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/rygel-0-12] external: Don't crash on hierarchical update
- Date: Thu, 19 Jan 2012 10:33:29 +0000 (UTC)
commit 40abd1c79f97e6023c66ffc55fbfe3b1143c4eb9
Author: Jens Georg <mail jensge org>
Date: Wed Jan 18 17:37:47 2012 +0100
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 files changed, 9 insertions(+), 0 deletions(-)
---
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]