From 579e73130da4cb7e0c6b53fd31318eb2d1ad20d8 Mon Sep 17 00:00:00 2001 From: Richard Schwarting Date: Sun, 9 Jun 2013 23:34:43 -0400 Subject: [PATCH] DomNode.vala, NodeList.vala: make references to Document weak to break ref cycles preventing finalisation --- gxml/DomNode.vala | 2 +- gxml/NodeList.vala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gxml/DomNode.vala b/gxml/DomNode.vala index fe0d16c1..1c8ce36a 100644 --- a/gxml/DomNode.vala +++ b/gxml/DomNode.vala @@ -134,7 +134,7 @@ namespace GXml { /** * A link to the Document to which this node belongs. */ - public Document owner_document { + public weak Document owner_document { get; internal set; } diff --git a/gxml/NodeList.vala b/gxml/NodeList.vala index 9b93467c..02d1bdbf 100644 --- a/gxml/NodeList.vala +++ b/gxml/NodeList.vala @@ -413,7 +413,7 @@ namespace GXml { same with nodes from GetElementByTagName, made need separate impls for each */ // TODO: if necessary, create two versions that use parent instead of head - internal Document owner; + internal weak Document owner; internal abstract Xml.Node *head { get; set; } internal abstract Xml.Node *parent_as_xmlnode { get; } @@ -606,7 +606,7 @@ namespace GXml { /* ** NodeListIterator ***/ private class NodeListIterator : GenericNodeListIterator { - private Document doc; + private weak Document doc; private Xml.Node *cur; private Xml.Node *head; private Xml.Node *next_node; -- GitLab