Skip to content

Commit

Permalink
delete where there is new
Browse files Browse the repository at this point in the history
  • Loading branch information
sprsquish authored and polotek committed Apr 9, 2010
1 parent 6e49e01 commit 1ae9186
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/xml_document.cc
Expand Up @@ -147,6 +147,10 @@ XmlDocument::New(const v8::Arguments& args) {
*callback->Call(obj, 1, argv);
}

delete version;
if (encoding)
delete encoding;

return obj;
}

Expand Down
2 changes: 2 additions & 0 deletions src/xml_element.cc
Expand Up @@ -36,6 +36,8 @@ XmlElement::New(const v8::Arguments& args) {
(const xmlChar*)*name,
content ? (const xmlChar*)**content
: NULL);
if (content)
delete content;

v8::Persistent<v8::Object> obj =
LXJS_GET_MAYBE_BUILD(XmlElement, elem);
Expand Down

0 comments on commit 1ae9186

Please sign in to comment.