[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: |
Miroslaw Dobrzanski-Neumann |
Subject: |
Re: [Pnet-developers] [bug #16089] Garbage Collector does not call Finalizers if using Forms |
Date: |
Tue, 14 Mar 2006 13:38:10 +0100 |
User-agent: |
Mutt/1.5.9i |
On Tue, Mar 14, 2006 at 01:27:51PM +0100, Marc Haisenko wrote:
> 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).
use Visual C++.NET, the managed extensions have good chances to get into the
next C++ stamdard. There are both destructor and finalizer.
For C# you may use the dispose pattern to work with synchronous destruction
Regards
Mirosław
>
> C'ya,
> Marc
>
> --
> Marc Haisenko
> http://darkdust.net
> Today is Pungenday, the 73rd day of Chaos in the YOLD 3172
> _______________________________________________
> Pnet-developers mailing list
> address@hidden
> http://dotgnu.org/mailman/listinfo/pnet-developers
--
Mirosław Dobrzański-Neumann
E-mail: address@hidden
Die in dieser E-Mail enthaltenen Nachrichten und Anhaenge sind ausschliesslich
fuer den bezeichneten Adressaten bestimmt. Sie koennen rechtlich geschuetzte,
vertrauliche Informationen enthalten. Falls Sie nicht der bezeichnete Empfaenger
oder zum Empfang dieser E-Mail nicht berechtigt sind, ist die Verwendung,
Vervielfaeltigung oder Weitergabe von Nachrichten und Anhaengen untersagt.
Falls Sie diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte
unverzueglich den Absender und vernichten Sie die E-Mail.
This e-mail message and any attachment are intended exclusively for the named
addressee. They may contain confidential information which may also be
protected
by professional secrecy. Unless you are the named addressee (or authorised to
receive for the addressee) you may not copy or use this message or any
attachment
or disclose the contents to anyone else. If this e-mail was sent to you by
mistake
please notify the sender immediately and delete this e-mail.