From: Edward Faulkner Date: 2005-12-13T03:58:10+09:00 Subject: Re: GC in lambdas? --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 13, 2005 at 03:32:38AM +0900, ako... wrote: > > also note that lambda will prevent __everything__ in it's scope from __= ever__ > > being garbage collected. >=20 > could someone please confirm this? i am also interested to know why GC > is so different in lambdas and whether the objects will be collected > when lambda itself goes out of scope? There's nothing different about GC within lambdas. You simply need to be aware of how lambdas work. The lambda object needs to maintain references to everything that was visible within the scope where it was created. As long as the lambda object is alive, everything it references must also stay alive. If you allow the lambda object to be garbage-collected, the things it references will also be subject to garbage collection. =20 --hHWLQfXTYDoKhP50 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDncf8nhUz11p9MSARAs8qAKCZWpA+AqsllQGT7dBCddWa3V7vBgCePj2w hjDG4AkHvAf1OMFHv8iG9Ac= =lyGU -----END PGP SIGNATURE----- --hHWLQfXTYDoKhP50--