Skip to content

Commit

Permalink
making sure namespaces do not get GCd
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jun 2, 2009
1 parent e6362b8 commit cb3d8f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ext/nokogiri/xml_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ VALUE Nokogiri_wrap_xml_namespace(xmlDocPtr doc, xmlNsPtr node)

VALUE ns = Data_Wrap_Struct(cNokogiriXmlNamespace, 0, 0, node);

VALUE document = DOC_RUBY_OBJECT(doc);

VALUE node_cache = rb_iv_get(document, "@node_cache");
rb_ary_push(node_cache, ns);

rb_iv_set(ns, "@document", DOC_RUBY_OBJECT(doc));

node->_private = (void *)ns;
Expand Down

0 comments on commit cb3d8f3

Please sign in to comment.