I'm not skilled enough in this area to know for sure, but my gut
feeling is that there must be simpler solution.

Unfortunately I don't think so. Nobu suggested a reference counting solution, which I don't think would work, and isn't any simpler.

The implementation isn't so horrible, its mostly:

st_hash dependents

Document#register_dependent(VALUE object, callback)
{
  register in hash
}

Document#unregister_dependent(VALUE object)
{
  unregister in hash
}

Document#free
{
  loop over dependents
}

A Ruby programmer should never have to force the GC.

Yeah, I agree.

Anyway, I put in a test case for just this issue in one of the test suites (XPath I think). It should be commented out at the moment.

Charlie

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to