If you look at the source of a TDictionary, you will find that GetEnumerator (at its ancestor) calls DoGetEnumerator, which in TDictionary calls a re-entered version of GetEnumerator.
The re-entered TDictionary.GetEnumerator creates an instance of TPairEnumerator, which is passed as a dictionary to enumerate. The dictionary does not contain a link to TPairEnumerator. PairEnumerator does not receive notification of the destruction of its dictionary.
So yes, you need to free up the counter and avoid any access violations that you really have to do before destroying the dictionary that it lists.
source share