Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Another round of memory leak fixes. Also fixed include syntax

  • Loading branch information...
commit 97783566f8a95e2d19fe736b029206ce88402417 1 parent 61d1a5b
@polotek authored
View
2  src/html_document.cc
@@ -1,5 +1,5 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./html_document.h"
+#include "html_document.h"
namespace libxmljs {
View
4 src/html_document.h
@@ -2,8 +2,8 @@
#ifndef SRC_HTML_DOCUMENT_H_
#define SRC_HTML_DOCUMENT_H_
-#include "./libxmljs.h"
-#include "./xml_document.h"
+#include "libxmljs.h"
+#include "xml_document.h"
namespace libxmljs {
View
13 src/html_parser.cc
@@ -1,12 +1,13 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_syntax_error.h"
-#include "./html_parser.h"
-#include "./html_document.h"
+#include "xml_syntax_error.h"
+#include "html_parser.h"
+#include "html_document.h"
namespace libxmljs {
inline v8::Handle<v8::Value>
BuildDoc(xmlDoc *doc, v8::Handle<v8::Array> errors) {
+ v8::HandleScope scope;
if (doc == NULL) {
xmlFreeDoc(doc);
xmlError *error = xmlGetLastError();
@@ -24,7 +25,7 @@ BuildDoc(xmlDoc *doc, v8::Handle<v8::Array> errors) {
LXJS_GET_MAYBE_BUILD(HtmlDocument, doc);
HtmlDocument *document = LibXmlObj::Unwrap<HtmlDocument>(jsDoc);
document->errors = v8::Persistent<v8::Array>::New(errors);
- return jsDoc;
+ return scope.Close(jsDoc);
}
v8::Handle<v8::Value>
@@ -46,7 +47,7 @@ ParseHtmlString(const v8::Arguments& args) {
xmlSetStructuredErrorFunc(NULL, NULL);
- return BuildDoc(doc, errors);
+ return scope.Close(BuildDoc(doc, errors));
}
v8::Handle<v8::Value>
@@ -68,7 +69,7 @@ ParseHtmlFile(const v8::Arguments& args) {
xmlSetStructuredErrorFunc(NULL, NULL);
- return BuildDoc(doc, errors);
+ return scope.Close(BuildDoc(doc, errors));
}
void
View
2  src/html_parser.h
@@ -2,7 +2,7 @@
#ifndef SRC_HTML_PARSER_H_
#define SRC_HTML_PARSER_H_
-#include "./libxmljs.h"
+#include "libxmljs.h"
namespace libxmljs {
View
12 src/libxmljs.cc
@@ -1,10 +1,10 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./libxmljs.h"
-#include "./xml_syntax_error.h"
-#include "./xml_document.h"
-#include "./xml_node.h"
-#include "./xml_parser.h"
-#include "./html_parser.h"
+#include "libxmljs.h"
+#include "xml_syntax_error.h"
+#include "xml_document.h"
+#include "xml_node.h"
+#include "xml_parser.h"
+#include "html_parser.h"
namespace libxmljs {
View
4 src/libxmljs.h
@@ -84,7 +84,7 @@ class LibXMLJS {
} // namespace libxmljs
-#include "./natives.h"
-#include "./object_wrap.h"
+#include "natives.h"
+#include "object_wrap.h"
#endif // SRC_LIBXMLJS_H_
View
4 src/object_wrap.h
@@ -2,7 +2,7 @@
#ifndef SRC_OBJECT_WRAP_H_
#define SRC_OBJECT_WRAP_H_
-#include "./libxmljs.h"
+#include "libxmljs.h"
namespace libxmljs {
@@ -49,6 +49,8 @@ class LibXmlObj {
WeakCallback(v8::Persistent<v8::Value> value, void *data) {
LibXmlObj *obj = static_cast<LibXmlObj*>(data);
assert(value == obj->_handle);
+ //value.Dispose();
+ //value.Clear();
delete obj;
}
};
View
15 src/xml_attribute.cc
@@ -1,5 +1,5 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_attribute.h"
+#include "xml_attribute.h"
namespace libxmljs {
@@ -10,7 +10,7 @@ XmlAttribute::New(const v8::Arguments& args) {
v8::HandleScope scope;
// was created by BUILD_NODE
if (args.Length() == 1 && args[0]->StrictEquals(v8::Null()))
- return args.This();
+ return scope.Close(args.This());
XmlElement *element = LibXmlObj::Unwrap<XmlElement>(args[0]->ToObject());
@@ -41,7 +41,7 @@ XmlAttribute::Name(const v8::Arguments& args) {
XmlAttribute *attr = LibXmlObj::Unwrap<XmlAttribute>(args.This());
assert(attr);
- return attr->get_name();
+ return scope.Close(attr->get_name());
}
v8::Handle<v8::Value>
@@ -53,11 +53,11 @@ XmlAttribute::Value(const v8::Arguments& args) {
// attr.value('new value');
if (args.Length() > 0) {
attr->set_value(*v8::String::Utf8Value(args[0]));
- return args.This();
+ return scope.Close(args.This());
}
// attr.value();
- return attr->get_value();
+ return scope.Close(attr->get_value());
}
v8::Handle<v8::Value>
@@ -66,7 +66,7 @@ XmlAttribute::Node(const v8::Arguments& args) {
XmlAttribute *attr = LibXmlObj::Unwrap<XmlAttribute>(args.This());
assert(attr);
- return attr->get_element();
+ return scope.Close(attr->get_element());
}
v8::Handle<v8::Value>
@@ -80,12 +80,13 @@ XmlAttribute::get_name() {
v8::Handle<v8::Value>
XmlAttribute::get_value() {
+ v8::HandleScope scope;
xmlChar* value = xmlNodeGetContent(xml_obj);
if (value != NULL) {
v8::Handle<v8::String> ret_value = v8::String::New((const char*)value,
xmlStrlen(value));
xmlFree(value);
- return ret_value;
+ return scope.Close(ret_value);
}
return v8::Null();
View
6 src/xml_attribute.h
@@ -2,9 +2,9 @@
#ifndef SRC_XML_ATTRIBUTE_H_
#define SRC_XML_ATTRIBUTE_H_
-#include "./libxmljs.h"
-#include "./xml_element.h"
-#include "./xml_namespace.h"
+#include "libxmljs.h"
+#include "xml_element.h"
+#include "xml_namespace.h"
namespace libxmljs {
View
28 src/xml_document.cc
@@ -1,7 +1,7 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_document.h"
-#include "./xml_element.h"
-#include "./xml_namespace.h"
+#include "xml_document.h"
+#include "xml_element.h"
+#include "xml_namespace.h"
namespace libxmljs {
@@ -10,7 +10,7 @@ v8::Persistent<v8::FunctionTemplate> XmlDocument::constructor_template;
v8::Handle<v8::Value>
XmlDocument::Doc(const v8::Arguments& args) {
v8::HandleScope scope;
- return args.This();
+ return scope.Close(args.This());
}
v8::Handle<v8::Value>
@@ -19,7 +19,7 @@ XmlDocument::Errors(const v8::Arguments& args) {
XmlDocument *document = LibXmlObj::Unwrap<XmlDocument>(args.This());
assert(document);
- return document->errors;
+ return scope.Close(document->errors);
}
v8::Handle<v8::Value>
@@ -29,11 +29,11 @@ XmlDocument::Encoding(const v8::Arguments& args) {
assert(document);
if (args.Length() == 0)
- return document->get_encoding();
+ return scope.Close(document->get_encoding());
v8::String::Utf8Value encoding(args[0]->ToString());
document->set_encoding(*encoding);
- return args.This();
+ return scope.Close(args.This());
}
v8::Handle<v8::Value>
@@ -42,7 +42,7 @@ XmlDocument::Version(const v8::Arguments& args) {
XmlDocument *document = LibXmlObj::Unwrap<XmlDocument>(args.This());
assert(document);
- return document->get_version();
+ return scope.Close(document->get_version());
}
v8::Handle<v8::Value>
@@ -52,7 +52,7 @@ XmlDocument::Root(const v8::Arguments& args) {
assert(document);
if (args.Length() == 0)
- return document->get_root();
+ return scope.Close(document->get_root());
if (document->has_root())
return ThrowException(v8::Exception::Error(
@@ -61,7 +61,7 @@ XmlDocument::Root(const v8::Arguments& args) {
XmlElement *element = LibXmlObj::Unwrap<XmlElement>(args[0]->ToObject());
assert(element);
document->set_root(element->xml_obj);
- return args[0];
+ return scope.Close(args[0]);
}
v8::Handle<v8::Value>
@@ -69,7 +69,7 @@ XmlDocument::ToString(const v8::Arguments& args) {
v8::HandleScope scope;
XmlDocument *document = LibXmlObj::Unwrap<XmlDocument>(args.This());
assert(document);
- return document->to_string();
+ return scope.Close(document->to_string());
}
@@ -87,7 +87,7 @@ XmlDocument::New(const v8::Arguments& args) {
case 1: // newDocument(version|callback)
// was created by BUILD_NODE
if (args[0]->StrictEquals(v8::Null()))
- return args.This();
+ return scope.Close(args.This());
if (args[0]->IsString()) {
version = new v8::String::Utf8Value(args[0]->ToString());
@@ -151,7 +151,7 @@ XmlDocument::New(const v8::Arguments& args) {
if (encoding)
delete encoding;
- return obj;
+ return scope.Close(obj);
}
XmlDocument::~XmlDocument() {
@@ -193,7 +193,7 @@ XmlDocument::to_string() {
v8::Local<v8::String> str = v8::String::New((const char*)buffer, len);
xmlFree(buffer);
- return str;
+ return scope.Close(str);
}
bool
View
2  src/xml_document.h
@@ -2,7 +2,7 @@
#ifndef SRC_XML_DOCUMENT_H_
#define SRC_XML_DOCUMENT_H_
-#include "./libxmljs.h"
+#include "libxmljs.h"
namespace libxmljs {
View
48 src/xml_element.cc
@@ -1,8 +1,8 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_element.h"
-#include "./xml_document.h"
-#include "./xml_attribute.h"
-#include "./xml_xpath_context.h"
+#include "xml_element.h"
+#include "xml_document.h"
+#include "xml_attribute.h"
+#include "xml_xpath_context.h"
namespace libxmljs {
@@ -17,7 +17,7 @@ XmlElement::New(const v8::Arguments& args) {
v8::HandleScope scope;
// was created by BUILD_NODE
if (args.Length() == 0 || args[0]->StrictEquals(v8::Null()))
- return args.This();
+ return scope.Close(args.This());
XmlDocument *document = LibXmlObj::Unwrap<XmlDocument>(args[0]->ToObject());
v8::String::Utf8Value name(args[1]);
@@ -62,7 +62,7 @@ XmlElement::New(const v8::Arguments& args) {
*callback->Call(obj, 1, argv);
}
- return obj;
+ return scope.Close(obj);
}
v8::Handle<v8::Value>
@@ -72,11 +72,11 @@ XmlElement::Name(const v8::Arguments& args) {
assert(element);
if (args.Length() == 0)
- return element->get_name();
+ return scope.Close(element->get_name());
v8::String::Utf8Value name(args[0]->ToString());
element->set_name(*name);
- return args.This();
+ return scope.Close(args.This());
}
v8::Handle<v8::Value>
@@ -92,7 +92,7 @@ XmlElement::Attr(const v8::Arguments& args) {
// return the named attribute
if (args[0]->IsString()) {
v8::String::Utf8Value name(args[0]);
- return element->get_attr(*name);
+ return scope.Close(element->get_attr(*name));
// create a new attribute from a hash
} else {
@@ -115,7 +115,7 @@ XmlElement::Attr(const v8::Arguments& args) {
element->set_attr(*name, *value);
}
- return args.This();
+ return scope.Close(args.This());
}
v8::Handle<v8::Value>
@@ -124,7 +124,7 @@ XmlElement::Attrs(const v8::Arguments& args) {
XmlElement *element = LibXmlObj::Unwrap<XmlElement>(args.This());
assert(element);
- return element->get_attrs();
+ return scope.Close(element->get_attrs());
}
v8::Handle<v8::Value>
@@ -137,7 +137,7 @@ XmlElement::AddChild(const v8::Arguments& args) {
assert(child);
element->add_child(child);
- return args.This();
+ return scope.Close(args.This());
}
v8::Handle<v8::Value>
@@ -168,7 +168,7 @@ XmlElement::Find(const v8::Arguments& args) {
}
}
- return ctxt.evaluate((const xmlChar*)*xpath);
+ return scope.Close(ctxt.evaluate((const xmlChar*)*xpath));
}
v8::Handle<v8::Value>
@@ -177,7 +177,7 @@ XmlElement::NextElement(const v8::Arguments& args) {
XmlElement *element = LibXmlObj::Unwrap<XmlElement>(args.This());
assert(element);
- return element->get_next_element();
+ return scope.Close(element->get_next_element());
}
v8::Handle<v8::Value>
@@ -186,7 +186,7 @@ XmlElement::PrevElement(const v8::Arguments& args) {
XmlElement *element = LibXmlObj::Unwrap<XmlElement>(args.This());
assert(element);
- return element->get_prev_element();
+ return scope.Close(element->get_prev_element());
}
v8::Handle<v8::Value>
@@ -196,13 +196,13 @@ XmlElement::Text(const v8::Arguments& args) {
assert(element);
if (args.Length() == 0) {
- return element->get_content();
+ return scope.Close(element->get_content());
} else {
element->set_content(*v8::String::Utf8Value(args[0]));
}
- return args.This();
+ return scope.Close(args.This());
}
v8::Handle<v8::Value>
@@ -233,9 +233,9 @@ XmlElement::ChildNodes(const v8::Arguments& args) {
assert(element);
if (args[0]->IsNumber())
- return element->get_child(args[0]->ToNumber()->Value());
+ return scope.Close(element->get_child(args[0]->ToNumber()->Value()));
- return element->get_child_nodes();
+ return scope.Close(element->get_child_nodes());
}
v8::Handle<v8::Value>
@@ -244,7 +244,7 @@ XmlElement::Path(const v8::Arguments& args) {
XmlElement *element = LibXmlObj::Unwrap<XmlElement>(args.This());
assert(element);
- return element->get_path();
+ return scope.Close(element->get_path());
}
v8::Handle<v8::Value>
@@ -258,7 +258,7 @@ XmlElement::AddPrevSibling(const v8::Arguments& args) {
element->add_prev_sibling(new_sibling);
- return args[0];
+ return scope.Close(args[0]);
}
v8::Handle<v8::Value>
@@ -272,7 +272,7 @@ XmlElement::AddNextSibling(const v8::Arguments& args) {
element->add_next_sibling(new_sibling);
- return args[0];
+ return scope.Close(args[0]);
}
void
@@ -326,7 +326,7 @@ XmlElement::get_attrs() {
push->Call(attributes, 1, argv);
} while ((attr = attr->next));
- return attributes;
+ return scope.Close(attributes);
}
void
@@ -370,7 +370,7 @@ XmlElement::get_child_nodes() {
LXJS_GET_MAYBE_BUILD(XmlElement, node));
}
- return children;
+ return scope.Close(children);
}
v8::Handle<v8::Value>
View
4 src/xml_element.h
@@ -2,8 +2,8 @@
#ifndef SRC_XML_ELEMENT_H_
#define SRC_XML_ELEMENT_H_
-#include "./libxmljs.h"
-#include "./xml_node.h"
+#include "libxmljs.h"
+#include "xml_node.h"
namespace libxmljs {
View
10 src/xml_namespace.cc
@@ -1,6 +1,6 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_namespace.h"
-#include "./xml_node.h"
+#include "xml_namespace.h"
+#include "xml_node.h"
namespace libxmljs {
@@ -10,7 +10,7 @@ v8::Handle<v8::Value>
XmlNamespace::New(const v8::Arguments& args) {
v8::HandleScope scope;
if (args[0]->StrictEquals(v8::Null()))
- return args.This();
+ return scope.Close(args.This());
// TODO(sprsquish): ensure this is an actual Node object
if (!args[0]->IsObject())
@@ -42,7 +42,7 @@ XmlNamespace::Href(const v8::Arguments& args) {
v8::HandleScope scope;
XmlNamespace *ns = LibXmlObj::Unwrap<XmlNamespace>(args.This());
assert(ns);
- return ns->get_href();
+ return scope.Close(ns->get_href());
}
v8::Handle<v8::Value>
@@ -50,7 +50,7 @@ XmlNamespace::Prefix(const v8::Arguments& args) {
v8::HandleScope scope;
XmlNamespace *ns = LibXmlObj::Unwrap<XmlNamespace>(args.This());
assert(ns);
- return ns->get_prefix();
+ return scope.Close(ns->get_prefix());
}
v8::Handle<v8::Value>
View
2  src/xml_namespace.h
@@ -2,7 +2,7 @@
#ifndef SRC_XML_NAMESPACE_H_
#define SRC_XML_NAMESPACE_H_
-#include "./libxmljs.h"
+#include "libxmljs.h"
namespace libxmljs {
View
30 src/xml_node.cc
@@ -1,9 +1,9 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_node.h"
-#include "./xml_document.h"
-#include "./xml_namespace.h"
-#include "./xml_element.h"
-#include "./xml_attribute.h"
+#include "xml_node.h"
+#include "xml_document.h"
+#include "xml_namespace.h"
+#include "xml_element.h"
+#include "xml_attribute.h"
namespace libxmljs {
@@ -15,7 +15,7 @@ XmlNode::Doc(const v8::Arguments& args) {
XmlNode *node = LibXmlObj::Unwrap<XmlNode>(args.This());
assert(node);
- return node->get_doc();
+ return scope.Close(node->get_doc());
}
v8::Handle<v8::Value>
@@ -26,10 +26,10 @@ XmlNode::Namespace(const v8::Arguments& args) {
// #namespace() Get the node's namespace
if (args.Length() == 0)
- return node->get_namespace();
+ return scope.Close(node->get_namespace());
if (args[0]->IsNull())
- return node->remove_namespace();
+ return scope.Close(node->remove_namespace());
XmlNamespace *ns = NULL;
@@ -72,7 +72,7 @@ XmlNode::Namespace(const v8::Arguments& args) {
node->set_namespace(ns->xml_obj);
- return node->get_namespace();
+ return scope.Close(node->get_namespace());
}
v8::Handle<v8::Value>
@@ -81,7 +81,7 @@ XmlNode::Parent(const v8::Arguments& args) {
XmlNode *node = LibXmlObj::Unwrap<XmlNode>(args.This());
assert(node);
- return node->get_parent();
+ return scope.Close(node->get_parent());
}
v8::Handle<v8::Value>
@@ -90,7 +90,7 @@ XmlNode::PrevSibling(const v8::Arguments& args) {
XmlNode *node = LibXmlObj::Unwrap<XmlNode>(args.This());
assert(node);
- return node->get_prev_sibling();
+ return scope.Close(node->get_prev_sibling());
}
v8::Handle<v8::Value>
@@ -99,7 +99,7 @@ XmlNode::NextSibling(const v8::Arguments& args) {
XmlNode *node = LibXmlObj::Unwrap<XmlNode>(args.This());
assert(node);
- return node->get_next_sibling();
+ return scope.Close(node->get_next_sibling());
}
v8::Handle<v8::Value>
@@ -108,7 +108,7 @@ XmlNode::Type(const v8::Arguments& args) {
XmlNode *node = LibXmlObj::Unwrap<XmlNode>(args.This());
assert(node);
- return node->get_type();
+ return scope.Close(node->get_type());
}
v8::Handle<v8::Value>
@@ -117,7 +117,7 @@ XmlNode::ToString(const v8::Arguments& args) {
XmlNode *node = LibXmlObj::Unwrap<XmlNode>(args.This());
assert(node);
- return node->to_string();
+ return scope.Close(node->to_string());
}
v8::Handle<v8::Value>
@@ -128,7 +128,7 @@ XmlNode::Remove(const v8::Arguments& args) {
node->remove();
- return args.This();
+ return scope.Close(args.This());
}
XmlNode::XmlNode(xmlNode* node) : xml_obj(node) {
View
2  src/xml_node.h
@@ -2,7 +2,7 @@
#ifndef SRC_XML_NODE_H_
#define SRC_XML_NODE_H_
-#include "./libxmljs.h"
+#include "libxmljs.h"
namespace libxmljs {
View
15 src/xml_parser.cc
@@ -1,13 +1,14 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_syntax_error.h"
-#include "./xml_parser.h"
-#include "./xml_sax_parser.h"
-#include "./xml_document.h"
+#include "xml_syntax_error.h"
+#include "xml_parser.h"
+#include "xml_sax_parser.h"
+#include "xml_document.h"
namespace libxmljs {
inline v8::Handle<v8::Value>
BuildDoc(xmlDoc *doc, v8::Persistent<v8::Array> jsErrArray) {
+ v8::HandleScope scope;
if (doc == NULL) {
xmlFreeDoc(doc);
xmlError *error = xmlGetLastError();
@@ -25,7 +26,7 @@ BuildDoc(xmlDoc *doc, v8::Persistent<v8::Array> jsErrArray) {
LXJS_GET_MAYBE_BUILD(XmlDocument, doc);
XmlDocument *document = LibXmlObj::Unwrap<XmlDocument>(jsDoc);
document->errors = jsErrArray;
- return jsDoc;
+ return scope.Close(jsDoc);
}
v8::Handle<v8::Value>
@@ -47,7 +48,7 @@ ParseXmlString(const v8::Arguments& args) {
xmlSetStructuredErrorFunc(NULL, NULL);
- return BuildDoc(doc, errors);
+ return scope.Close(BuildDoc(doc, errors));
}
v8::Handle<v8::Value>
@@ -69,7 +70,7 @@ ParseXmlFile(const v8::Arguments& args) {
xmlSetStructuredErrorFunc(NULL, NULL);
- return BuildDoc(doc, errors);
+ return scope.Close(BuildDoc(doc, errors));
}
void
View
2  src/xml_parser.h
@@ -2,7 +2,7 @@
#ifndef SRC_XML_PARSER_H_
#define SRC_XML_PARSER_H_
-#include "./libxmljs.h"
+#include "libxmljs.h"
namespace libxmljs {
View
6 src/xml_sax_parser.cc
@@ -1,5 +1,5 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_sax_parser.h"
+#include "xml_sax_parser.h"
namespace libxmljs {
@@ -73,7 +73,7 @@ XmlSaxParser::NewParser(const v8::Arguments& args) {
"Bad argument: function required");
parser->SetCallbacks(args.This(), v8::Local<v8::Function>::Cast(args[0]));
- return args.This();
+ return scope.Close(args.This());
}
v8::Handle<v8::Value>
@@ -85,7 +85,7 @@ XmlSaxParser::NewPushParser(const v8::Arguments& args) {
XmlSaxParser *parser = LibXmlObj::Unwrap<XmlSaxParser>(args.Holder());
parser->initialize_push_parser();
- return return_val;
+ return scope.Close(return_val);
}
void
View
4 src/xml_sax_parser.h
@@ -2,8 +2,8 @@
#ifndef SRC_XML_SAX_PARSER_H_
#define SRC_XML_SAX_PARSER_H_
-#include "./libxmljs.h"
-#include "./xml_parser.h"
+#include "libxmljs.h"
+#include "xml_parser.h"
namespace libxmljs {
View
4 src/xml_syntax_error.cc
@@ -1,5 +1,5 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_syntax_error.h"
+#include "xml_syntax_error.h"
namespace libxmljs {
@@ -26,7 +26,7 @@ XmlSyntaxError::New(const v8::Arguments& args) {
XmlSyntaxError *error = new XmlSyntaxError(err);
error->Wrap(args.This());
- return args.This();
+ return scope.Close(args.This());
}
#define STRING_OR_NULL(error, field) \
View
2  src/xml_syntax_error.h
@@ -2,7 +2,7 @@
#ifndef SRC_XML_SYNTAX_ERROR_H_
#define SRC_XML_SYNTAX_ERROR_H_
-#include "./libxmljs.h"
+#include "libxmljs.h"
namespace libxmljs {
View
6 src/xml_xpath_context.cc
@@ -1,6 +1,6 @@
// Copyright 2009, Squish Tech, LLC.
-#include "./xml_xpath_context.h"
-#include "./xml_element.h"
+#include "xml_xpath_context.h"
+#include "xml_element.h"
namespace libxmljs {
@@ -45,7 +45,7 @@ XmlXpathContext::evaluate(const xmlChar* xpath) {
xmlXPathFreeObject(result);
- return nodes;
+ return scope.Close(nodes);
}
} // namespace libxmljs
View
2  src/xml_xpath_context.h
@@ -2,7 +2,7 @@
#ifndef SRC_XML_XPATH_CONTEXT_H_
#define SRC_XML_XPATH_CONTEXT_H_
-#include "./libxmljs.h"
+#include "libxmljs.h"
namespace libxmljs {
Please sign in to comment.
Something went wrong with that request. Please try again.