Skip to content

Dispose enumerators during type traversal - #578

Open
SychicBoy wants to merge 1 commit into
0xd4d:masterfrom
SychicBoy:fix/issue-560-dispose-enumerators
Open

Dispose enumerators during type traversal#578
SychicBoy wants to merge 1 commit into
0xd4d:masterfrom
SychicBoy:fix/issue-560-dispose-enumerators

Conversation

@SychicBoy

Copy link
Copy Markdown

This change addresses #560 by ensuring that enumerators created by AllTypesHelper.Types() and Metadata.AddExportedTypes() are properly disposed.

Enumerators are disposed as soon as they are exhausted, while a finally block disposes any that remain active if traversal ends early or due to an exception.

This is especially important for AllTypesHelper.Types(), where callers may stop enumeration before the full type hierarchy has been traversed.

Fixes #560

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need to dispose of enumerators

1 participant