[gxml: 15/18] DomNode.vala, NodeList.vala: make references to Document weak to break ref cycles preventing finalis
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml: 15/18] DomNode.vala, NodeList.vala: make references to Document weak to break ref cycles preventing finalis
- Date: Tue, 18 Jun 2013 18:15:13 +0000 (UTC)
commit 579e73130da4cb7e0c6b53fd31318eb2d1ad20d8
Author: Richard Schwarting <aquarichy gmail com>
Date: Sun Jun 9 23:34:43 2013 -0400
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 fe0d16c..1c8ce36 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 9b93467..02d1bdb 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]