>>>>> "T" == Tilman Sauerbeck <tilman / code-monkey.de> writes: T> Is the order, in which the GC claims the objects at this point, defined T> at all or does it claim them in undefined order? It's like the key for an hash : there is a defined order but you can't predict it :-) T> In my Ruby extension, there are "parent" objects and "child" objects. T> The "parent" object must not be freed if there are still "child" objects T> alive. I enforce this policy by using rb_gc_mark(). This seems to work, T> cause there are no problems as long as the ruby script executes. You are just lucky :-) One day, probably, you'll have a problem. T> However, when I quit the application, the GC seems to break this policy. You must write your extension, in such a way that the child are freed before the parent. Never expect that ruby will do this for you. Guy Decoux