A type is responsible for disposing of all its unmanaged resources; this is accomplished by implementing IDisposable. This rule checks to see whether a disposable type T declares a field F that is an instance of a disposable type FT. For each field F, the rule attempts to locate a call to FT.Dispose. The rule searches the methods called by T.Dispose, and one level lower (the methods called by the methods called by FT.Dispose).

It is safe to suppress a warning from this rule if you are not responsible for releasing the resource held by the field, or if the call to Dispose occurs at a deeper calling level than the rule checks.

The following example shows a type TypeB that violates this rule by declaring a field aFieldOfADisposableType (F in the previous discussion) as a disposable type (TypeA) and not calling Dispose on the field. TypeB corresponds to T in the previous discussion.