Making a lot of calls to Document.file will result in a "too many open files error". I think what is happening
is that the parser isn't cleaned up until it is finalized by garbage collection. Calling GC.start from time to time
supresses this error and is a workaround.
Really there should be a way of telling the parser to clean up its resources, and convenience methods such as Document.file
should be using it. Perhaps even the parser should be expected to clean up its resources as soon as the document is
parsed, I'm not entirely sure. |