On Tue, Dec 03, 2002 at 09:46:06PM +0900, Shannon Fang wrote:
> Hi,
> 
> While reading the discussion on Garbage Collection, I suddenly thought of 
> one question: for the following code
> 
> conn=WIN32OLE.new("ADODB.Connection")
> conn.open(...)
> 
> do I need to manually call conn.Close, or ruby will take care of that for 
> me?

I don't know the WIN32 API, but if this is at all like a file handle the
following will happen:
 * conn won't be garbage collected if that reference is still around,
   and the connection won't close as long as the object exists 
 * the object will eventually be GC'ed and the handle closed if Ruby
   gets out of memory or file handles (ports?)


-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Netscape is not a newsreader, and probably never shall be.
	-- Tom Christiansen