Skip to content
This repository
Browse code

fix clone method: set doc on nodes to avoid a segfault when XmlNode::…

…XmlNode reads xml_obj->doc->_private
  • Loading branch information...
commit 68ec74507de46fe2d2de66697ea454845672be01 1 parent b58bfbb
Thomas Riccardi authored July 17, 2012

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  src/xml_node.cc
3  src/xml_node.cc
@@ -295,7 +295,8 @@ v8::Handle<v8::Value>
295 295
 XmlNode::clone(bool recurse) {
296 296
   v8::HandleScope scope;
297 297
 
298  
-  return scope.Close(XmlNode::New(xmlCopyNode(xml_obj, recurse)));
  298
+  xmlNode* new_xml_obj = xmlDocCopyNode(xml_obj, xml_obj->doc, recurse);
  299
+  return scope.Close(XmlNode::New(new_xml_obj));
299 300
 }
300 301
 
301 302
 v8::Handle<v8::Value>

0 notes on commit 68ec745

Please sign in to comment.
Something went wrong with that request. Please try again.