Skip to content

Commit

Permalink
rooting nodes after duplication. fixes #353
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Oct 19, 2010
1 parent d5cddbd commit 42920e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* XML::Node#{replace,add_previous_sibling,add_next_sibling} edge cases fixed related to libxml's text node merging. #308
* Fixed a segfault when GC occurs during xpath handler argument marshalling. #345
* Added hack to Slop decorator to work with previously defined methods. #330
* Fix a memory leak when duplicating child nodes. #353

=== 1.4.3 / 2010/07/28

Expand Down
2 changes: 2 additions & 0 deletions ext/nokogiri/xml_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ static VALUE duplicate_node(int argc, VALUE *argv, VALUE self)
dup = xmlDocCopyNode(node, node->doc, (int)NUM2INT(level));
if(dup == NULL) return Qnil;

NOKOGIRI_ROOT_NODE(dup);

return Nokogiri_wrap_xml_node(rb_obj_class(self), dup);
}

Expand Down

0 comments on commit 42920e6

Please sign in to comment.