![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Michael Mattias is right. The GC decides if things are garbage by tracing root references (and so is not confused by circular references). If MyObject has the only reference to MySubObject, and the reference to MyObject is made null, then MySubObject is unreachable and is garbage. -Chris -------------------- From: Mattias Sjögren <mattias.dont.want.spam (AT) mvps (DOT) org Subject: Re: Garbage Collection Question Date: Fri, 18 Jul 2003 23:47:00 +0200 References: <03f001c34d71$bebdaa50$a301280a (AT) phx (DOT) gbl X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <OpzgVYXTDHA.1688 (AT) TK2MSFTNGP11 (DOT) phx.gbl Newsgroups: microsoft.public.dotnet.framework.clr NNTP-Posting-Host: g150.ryd.student.liu.se 130.236.238.150 Lines: 1 Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.clr:7371 X-Tomcat-NG: microsoft.public.dotnet.framework.clr Michael, My question is, will the Garbage Collector figure out that nobody needs MyObject anymore, and get rid of it along with MySubObject? Or, do I need to manually disconnect MyObject from MySubObject's event interface? The GC will handle it. Mattias -- Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ Please reply only to the newsgroup. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |