From 7ba19db66b1ba11b44ae8c636207c0c892fe0447 Mon Sep 17 00:00:00 2001 From: mental Date: Sun, 8 Jun 2008 20:42:25 +0000 Subject: [PATCH] force single single document over a node's lifetime --- src/jabber_whiteboard/inkboard-document.cpp | 2 +- src/xml/simple-document.h | 2 +- src/xml/simple-node.cpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jabber_whiteboard/inkboard-document.cpp b/src/jabber_whiteboard/inkboard-document.cpp index 7e4afff8d..d4274f139 100644 --- a/src/jabber_whiteboard/inkboard-document.cpp +++ b/src/jabber_whiteboard/inkboard-document.cpp @@ -44,7 +44,7 @@ namespace Whiteboard { InkboardDocument::InkboardDocument(int code, State::SessionType sessionType, Glib::ustring const& to) -: XML::SimpleNode(code, NULL), sessionType(sessionType), recipient(to), +: XML::SimpleNode(code, this), sessionType(sessionType), recipient(to), _in_transaction(false) { _initBindings(); diff --git a/src/xml/simple-document.h b/src/xml/simple-document.h index 9b3157add..f2648e188 100644 --- a/src/xml/simple-document.h +++ b/src/xml/simple-document.h @@ -30,7 +30,7 @@ class SimpleDocument : public SimpleNode, { public: explicit SimpleDocument() - : SimpleNode(g_quark_from_static_string("xml"), NULL), + : SimpleNode(g_quark_from_static_string("xml"), this), _in_transaction(false) { _initBindings(); diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp index 8ddc5b167..d4a412ae6 100644 --- a/src/xml/simple-node.cpp +++ b/src/xml/simple-node.cpp @@ -164,6 +164,8 @@ SimpleNode::SimpleNode(int code, Document *document) : Node(), _name(code), _attributes(), _child_count(0), _cached_positions_valid(false) { + g_assert(document != NULL); + this->_document = document; this->_parent = this->_next = NULL; this->_first_child = this->_last_child = NULL; @@ -178,6 +180,8 @@ SimpleNode::SimpleNode(SimpleNode const &node, Document *document) _child_count(node._child_count), _cached_positions_valid(node._cached_positions_valid) { + g_assert(document != NULL); + _document = document; _parent = _next = NULL; _first_child = _last_child = NULL; -- 2.30.2