[Mono-list] Accessing member objects in destructors
Grundgeiger, Dave
dave.grundgeiger@esker.com
Thu, 4 Mar 2004 12:30:59 -0600
>From "Overriding the Finalize Method" in the .NET Framework SDK
documentation:
"An object's Finalize method should not call a method on any objects =
other
than that of its base class. This is because the other objects being =
called
could be collected at the same time as the calling object, such as in =
the
case of a common language runtime shutdown."
Dave
-----Original Message-----
From: Gustavo Garc=EDa Bernardo [mailto:ggb@tid.es]=20
Sent: Thursday, March 04, 2004 11:24 AM
To: mono-list@ximian.com
Subject: [Mono-list] Accessing member objects in destructors
Hi,
Reading the Mono code i have seen sometimes a class destructor access a
method of a member object:
Socket socket =3D new Socket();
~XXXX
{
socket.Close ();
}
Is this correct? You can assert the socket object is not freed before =
XXX
object?
Thx, best regards.
G.
_______________________________________________
Mono-list maillist - Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list