From: Paul Brannan Date: 2001-11-29T06:32:03+09:00 Subject: [ruby-talk:26837] Re: Ref Counting (was KDE or GNOME curiosity question...) On Thu, 29 Nov 2001, mark hahn wrote: > I'm thinking now that using scope is the only good way to get quick > finalization, with the fopen/block trick being the best example. The problem with scoping is that it doesn't work if you need to share the object among many different other objects. I've never personally run into this problem, but I know that it can come up. Just recently, in [ruby-talk:25477], there was talk of wanting to close a database connection automatically. To summarize, the author wanted to use a finalizer, but he was (fortunately) able to use scoping instead. Matz said he was in favor of explicit disconnection from the database. However, imo, explicit disconnection could be error-prone, but it's probably the only reliable way to do this in Ruby for the cases where a block will not suffice. Paul