From de6c7df3c362fa0104e7d908c29614266caaa9d6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Jan 2015 16:19:13 +0000 Subject: fixed user search & addition git-svn-id: http://svn.miranda-ng.org/main/trunk@11918 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp') diff --git a/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp b/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp index cb3bc19258..7ef362ef4b 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp @@ -12,35 +12,35 @@ static std::string nilstr; -ProtocolTreeNode::ProtocolTreeNode(const string& tag, vector* data, vector *children) +ProtocolTreeNode::ProtocolTreeNode(const string &_tag, vector* _data, vector *_children) : + tag(_tag) { - this->tag = tag; - this->data = data; - this->attributes = NULL; - this->children = children; + data = _data; + attributes = NULL; + children = _children; } -ProtocolTreeNode::ProtocolTreeNode(const string& tag, ProtocolTreeNode* child) +ProtocolTreeNode::ProtocolTreeNode(const string &_tag, ProtocolTreeNode *_child) : + tag(_tag) { - this->tag = tag; this->data = NULL; this->attributes = NULL; - this->children = new std::vector(1); - (*this->children)[0] = child; + this->children = new std::vector(); + children->push_back(_child); } ProtocolTreeNode::~ProtocolTreeNode() { - if (this->attributes != NULL) - delete this->attributes; + delete this->attributes; + if (this->children != NULL) { for (size_t i = 0; i < this->children->size(); i++) if (this->children->at(i) != NULL) delete this->children->at(i); delete this->children; } - if (this->data != NULL) - delete data; + + delete data; } -- cgit v1.2.3