[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pnet-developers] [bug #16089] Garbage Collector does not call Final
From: |
Marc Haisenko |
Subject: |
Re: [Pnet-developers] [bug #16089] Garbage Collector does not call Finalizers if using Forms |
Date: |
Tue, 14 Mar 2006 13:27:51 +0100 |
User-agent: |
KMail/1.8.1 |
On Tuesday 14 March 2006 12:34, Heiko Weiss wrote:
> The GC does not call the Finalizers, if showing a form and closing it.
> Have attached a small sample.
> Form1:
> Click on button1 -> a 2nd form Form2 is created.
> Form2:
> is using a testclass XXX with Finalizer.
> Close the Form2.
>
> Now click button Collect of Form1.
> The GC should call the Finalizer of class XXX.
>
> BUT is not called.
>
> I think theres a problem with forms only.
> if I use class XXX in a Console-App with new XXX() and do GC.Collect, the
> GC is calling the Finalizer.
> So it must be a bug in using SWF.
>
> Please help urgent!!!
>
> Thx
> Brubbel
This is the normal .NET GC behaviour and totally normal. .NET only guarantees
that finalizers are called at least when the application exits, otherwise you
can't make any assumptions on when they are called.
This is at least a minor improvement to Java which doesn't guarantee that they
are called at all.
So you can't do anything about it, AFAIK
One thing I really, *really* miss is a language with garbage collection where
you can explicitly delete an object with all consequences (call the
destructor, remove memory and clear resources like file handles).
C'ya,
Marc
--
Marc Haisenko
http://darkdust.net
Today is Pungenday, the 73rd day of Chaos in the YOLD 3172
pgpgG86lYXZ_e.pgp
Description: PGP signature