To answer your last two questions:
There are, by definition, no memory leaks in managed code. There are two kinds of leaks that can occur:
- Objects are released when no references to the object are alive. If you still have a reference to an object, it will not be released. This happens for instance when you throw away a reference to an object that has registered for an event - if you don't manually unregister the event handler (or use a weak reference), the event will still reference the object, so it will not be released although you have no obvious reference to it anymore.
- Unmanaged resources can be leaked. Typically, a wrapper for unmanaged resources implements IDisposable and will free the resource when you call Dispose. If you just throw away the object, it will not release the resource and therefore leak it.
So, two rules of thumb are:
- Unregister any event handler when you release an object, or use a weak reference for that (search on SO, it's explained somewhere).
- If a class exposes a Dispose method, call it. If you use the object only temporarily, use the using construct. If you have members that implement IDisposable, implement IDisposable yourself and call the members' Dispose in your Dispose.