>>>>> "C" == Christian Neukirchen <chneukirchen / gmail.com> writes:

C> Could you maybe explain *why* that "fix" works?

 Well, when you work with 'dl', this is like when you write an extension,
 you must help ruby and say it which variable must be marked.

 In your case, when ruby leave #initialize it will not able to see that
 `source' is used internally by libxml2. This is why the GC remove it.

 If you store it in an instance variable, ruby will mark it and it will be
 available to libxml2, even after the end of #initialize


Guy Decoux