From: Tilman Sauerbeck Date: 2004-12-04T01:33:11+09:00 Subject: Re: GC run at end of script execution - order in which objects are claimed? Yukihiro Matsumoto [2004-12-03 17:21]: > Hi, > > In message "Re: GC run at end of script execution - order in which objects are claimed?" > on Sat, 4 Dec 2004 01:07:25 +0900, Tilman Sauerbeck writes: > > |In my Ruby extension, there are "parent" objects and "child" objects. > |The "parent" object must not be freed if there are still "child" objects > |alive. I enforce this policy by using rb_gc_mark(). This seems to work, > |cause there are no problems as long as the ruby script executes. > | > |However, when I quit the application, the GC seems to break this policy. > > Questions: > > Is it OK to terminate the process without any freeing? That would be very hackish IMHO :/ > Or is it mandatory to destruct objects in certain order? Since the random free'ing is causing sincere memory management problems in my extension, I'd say "yes". Although I think there must be some not-so-hard way to avoid this; there must have been extension developers who had the very same problem. -- Regards, Tilman