TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
franny
NA
11
0
Confused about Finalizer....
Nov 22 2004 9:53 AM
Hi, I have a class , WaveHdr. This class implements IDisposable. I also have a Finalizer for the class, ~WaveHdr. The Finalizer calls the Dispose method. Also, withing the class there is a method called read. In this method I allocate, on the heap, an byte array as a local variable. The read method is called many, many times. Here is what I am observing... The finalizer for the class is called as many times as I have allocated the byte array in the read method. Also the finalizer is invoked before I am done with the class. It looks like the finalizer is called when the byte array (local variable in the read method) turns into garbage. My question is , why does the finalizer for the CLASS get called when the bytes array turns into garbage? I was expecting that the finalizer for the CLASS would not be called until the class instance itself turned into garbage? Would greatly appreciate some insight on this. Thanks.
Reply
Answers (
1
)
How can I access server domain with remote object
C# Property