[Mono-list] Dispose method is never called

Giuseppe Greco gius.greco@bluewin.ch
Wed, 23 Jul 2003 09:31:42 +0200


Joeri,

I'm working with mono 0.25 on RedHad 9...
If I compile and execute fin.cs, I don't get
the finalizer called. fin2.cs works fine, insterad.

Gius_.

>-- Original Message --
>From: "Joeri Belis" <joeri.belis@nollekens.be>
>To: "Giuseppe Greco" <gius.greco@bluewin.ch>
>Cc: <mono-list@lists.ximian.com>
>Subject: Re: [Mono-list] Dispose method is never called
>Date: Wed, 23 Jul 2003 08:41:20 +0200
>
>
>Both programs give me the same output on mono 0.24
>
>C:\DOCUME~1\joeri\MIJNDO~1\SHARPD~1\HELLOW~1>fin2
>Constructor
>Bye!
>Destructor
>Free unmanaged resources.
>
>C:\DOCUME~1\joeri\MIJNDO~1\SHARPD~1\HELLOW~1>fin
>Constructor
>Bye!
>Destructor
>Free unmanaged resources.
>
>
>----- Original Message ----- 
>From: "Giuseppe Greco" <gius.greco@bluewin.ch>
>To: "Joeri Belis" <joeri.belis@nollekens.be>; <mono-list@lists.ximian.com>
>Sent: Tuesday, July 22, 2003 7:44 PM
>Subject: Re: [Mono-list] Dispose method is never called
>
>
>> 
>> >-- Original Message --
>> >From: "Joeri Belis" <joeri.belis@nollekens.be>
>> >To: <mono-list@lists.ximian.com>
>> >Subject: Re: [Mono-list] Dispose method is never called
>> >Date: Tue, 22 Jul 2003 11:54:08 +0200
>> >
>> >
>> >It compiled and ran the "MyFinalizer()" example with and without lines
>(
>> >13 -> 15 )
>> >but is get the same output results. Is this what to expect?
>> >
>> >C:\DOCUME~1\joeri\MIJNDO~1\SHARPD~1\HELLOW~1>fin.exe
>> >Constructor
>> >Bye!
>> >Destructor
>> >Free unmanaged resources.
>> 
>> Yes, but when I run the example, I don't get the last two
>> messages...
>> 
>> Have you commented out lines 13, 14, and 15?
>> 
>> Gius_.
>> >
>> >>
>> >> Gonzalo, in mono-threaded applications the destructor
>> >> (or Finalize method) is called, but in multi-threaded
>> >> ones it isn't. Please try the attached program. As you
>> >> will see, the thread method is brutally interrupted and
>> >> the finalizer is never called.
>> >>
>> >> If you comment out line 13, 14, and 15 in finalizer.cs,
>> >> then it works fine.
>> >>
>> >> I hope that helps...
>> >>
>> >> Gius_.
>> >>
>> >
>> >
>> >_______________________________________________
>> >Mono-list maillist  -  Mono-list@lists.ximian.com
>> >http://lists.ximian.com/mailman/listinfo/mono-list
>> 
>> 
>> 
>> 
>
>Attachment: fin.cs
>
>
>Attachment: fin2.cs
>