This technique creates a strong reference from the event source to the event listener. Ordinarily, attaching an event handler for a listener causes the listener to have an object lifetime that influenced by the object lifetime for the source (unless the event handler is explicitly removed)....

You wrote:...This means that if you have an object that has an event and there are other object that are subscribed to that event, the original object won't be properly disposed until all events are unsubscribed since an event is a strong reference....

It is not original object wont be disposed but listener. so in example above:

source.SomeEvent += new EventHandler(listener.OnSomeEvent);

listener wont be disposed while source is alive. so if there are no reference to source it will be collected even it has listeners attached, but if no reference to listener and it is subscribed to some of source's event, it will NOT be collected until source is collected.

events are delegates. delegates are strong references.the object that fires the event has a refernce to the object subscribed to that event via that delegate. so they both know about each other until the subscribed object unsubscribes form an event.

Mladen, you're just wrong about the circular references. Save yourself further embarrassment and just delete this blog post. Read Ian Griffiths' article and take comfort in the fact that aren't the first and won't be the last to misunderstand how the .NET GC works, or how circular references are handled in GC environments.

I'd also like to recommend a new problem solving approach for you in the future:

1. First show a simple example that demonstrates the problem that you claim exists (a form and the handler classes NOT being finalized by the GC when fully-dereferenced)2. Show your supposed fix

If you're going to skip step 1, at least realize that if your solution to the Next Big Problem involves everyone in the world adding code to common classes to fix what you see as a fundamental problem that nobody else has reported, maybe you should take a closer look at how you're writing code to make sure it's not just something you're doing wrong. I guarantee this will save face in the future.

yes i know i'm wrong. i thought we came to that conclusion with Sergio already.thank you for pointing it out :)))

There's no need to save my face, since i'm not the first person to be wrong, right?For me the main thing is to learn something new which i have.and no i won't delete the post. i'll just update it with the correct information, when i came around to itl

Could you please help me out to find a book which contains the programming basics of C#? The book which can be followed in lab experiments ( from beginners to advanced). The book which can tell you how to give inputs through console; be it an array, a string or a single character.

why not just find/replace and do a search for += new in all open documents, then copy paste all event handlers into notepad then paste them into your dispose() method in the .cs designer and replace + with - ?

Sure that would be alot easyier and time consuming than trying to fix something that isnt broken?

Thank you for keeping this wrong blog post open as the ensuing discussion is very important. The author, by solving a problem that doesn't exist helps to solve a wider problem of misunderstanding in this area.