public
Description: Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser with XPath and CSS selector support.
Homepage: http://nokogiri.rubyforge.org/
Clone URL: git://github.com/tenderlove/nokogiri.git
fixing memory issues. removing old code that freed the context object on 
error, and making sure we deallocate only at garbage_collect time, not at 
gc_mark time.
mdalessio (author)
Tue Sep 30 09:16:34 -0700 2008
commit  8e34e5b2357dc308345f7f5dbd6c6d9720ec46d8
tree    95704d2073d4c49edb1ba91d0e0482f6f3fcffb0
parent  ff434d21e8cd63cf0aa15981711df205d75ed53a
...
37
38
39
40
41
42
43
...
52
53
54
55
 
56
57
58
...
37
38
39
 
40
41
42
...
51
52
53
 
54
55
56
57
0
@@ -37,7 +37,6 @@ static VALUE evaluate(VALUE self, VALUE search_path)
0
   xmlChar* query = (xmlChar *)StringValuePtr(search_path);
0
   xmlXPathObjectPtr xpath = xmlXPathEvalExpression(query, ctx);
0
   if(xpath == NULL) {
0
- xmlXPathFreeContext(ctx);
0
     rb_raise(rb_eRuntimeError, "Couldn't evaluate expression '%s'", query);
0
   }
0
   return Nokogiri_wrap_xml_xpath(xpath);
0
@@ -52,7 +51,7 @@ static VALUE new(VALUE klass, VALUE nodeobj)
0
 
0
   xmlXPathContextPtr ctx = xmlXPathNewContext(node->doc);
0
   ctx->node = node ;
0
- return Data_Wrap_Struct(klass, deallocate, 0, ctx);
0
+ return Data_Wrap_Struct(klass, 0, deallocate, ctx);
0
 }
0
 
0
 VALUE cNokogiriXmlXpathContext;

Comments

    No one has commented yet.