From: "Mauricio Fernández" Date: 2002-12-03T23:39:11+09:00 Subject: Re: GC on WIN32OLE 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