From: Dave Thomas Date: 2001-02-23T07:38:46+09:00 Subject: [ruby-talk:11355] Re: Any way to control order in which objects are GC'd? "Lyle Johnson" writes: > Ruby, of course, doesn't have the concept of C++ destructors. When > the GC detects that an object is no longer in use, it will get > "collected". So the problem I'm running into is that when object > "Foo" gets garbage collected (and the underlying C++ object "CFoo" > is destroyed), there are still other C++ objects out there that have > references to "CFoo". As soon as they try to access the recently > deceased object, bad things happen. Would it be possible to have the Ruby GC manage you C++ objects? That way you'd never have the problem, as an object with outstanding references wouldn't get collected. Guy could answer this better, but my impression is that the Ruby GC works with all the heap, and not just objects it creates. Dave