[gxml] Serialization.vala: add temporary fix to the no-ref Document problem (Serialization will keep the re



commit f3f46220914150426db11a893c9f163b060f5021
Author: Richard Schwarting <aquarichy gmail com>
Date:   Thu Aug 22 12:28:52 2013 -0400

    Serialization.vala: add temporary fix to the no-ref Document problem (Serialization will keep the refs); 
after 0.4, serialize_object will change to return a Document, like in the gsoc2013 branch, currently.

 gxml/Serialization.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gxml/Serialization.vala b/gxml/Serialization.vala
index 475e6c1..80c1d4f 100644
--- a/gxml/Serialization.vala
+++ b/gxml/Serialization.vala
@@ -180,6 +180,8 @@ namespace GXml {
                        return value_node;
                }
 
+               private static List<Document> _docs;
+
                /**
                 * Serializes a { link GLib.Object} into a { link GXml.DomNode}.
                 *
@@ -221,6 +223,7 @@ namespace GXml {
                                if (oid != "" && Serialization.serialize_cache.contains (oid)) {
                                        // GLib.message ("cache hit on oid %s", oid);
                                        doc = new Document ();
+                                       Serialization._docs.append (doc);
                                        root = doc.create_element ("ObjectRef");
                                        doc.append_child (root);
                                        root.set_attribute ("otype", object.get_type ().name ());
@@ -238,6 +241,8 @@ namespace GXml {
                                   a separate document for it to already be a
                                   part of as its owner_document. */
                                doc = new Document ();
+                               Serialization._docs.append (doc);
+
                                root = doc.create_element ("Object");
                                doc.append_child (root);
                                root.set_attribute ("otype", object.get_type ().name ());


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]