Skip to content

Fix enumerator not disposed when arbitrary projection is enumerated #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 22, 2022

Conversation

acjh
Copy link
Contributor

@acjh acjh commented Feb 20, 2022

Fixes #133

Let's directly foreach the enumerable, which automatically disposes the enumerator.

I have added a test which fails for v5.0.0 (and v4.1.3) and passes with the new changes: Should_dispose_enumerator_when_arbitrary_projection_is_enumerated

Backport request

Kindly backport to 4.x, so that this can be used in the same project that depends on AutoMapper.Collection, which does not support AutoMapper 11.x.
Reference: AutoMapper/AutoMapper.Collection#162

Copy link
Member

@BlaiseD BlaiseD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test which fails for v5.0.0 and passes with the new changes.

@acjh
Copy link
Contributor Author

acjh commented Feb 21, 2022

@BlaiseD Thanks for your response. As mentioned in the PR description, I need an assist to build this project first.

@BlaiseD
Copy link
Member

BlaiseD commented Feb 21, 2022

@BlaiseD Thanks for your response. As mentioned in the PR description, I need an assist to build this project first.

The CI and Release builds work - maybe do a web search for the issue you're running into?

@acjh
Copy link
Contributor Author

acjh commented Feb 22, 2022

@BlaiseD I have added the test.

@BlaiseD BlaiseD merged commit 4e85a57 into AutoMapper:master Feb 22, 2022
@BlaiseD
Copy link
Member

BlaiseD commented Feb 22, 2022

Thanks

@acjh
Copy link
Contributor Author

acjh commented Feb 23, 2022

Regarding the backport request to 4.x, should I submit a separate PR or will you handle that?

@BlaiseD
Copy link
Member

BlaiseD commented Feb 23, 2022

You may PR v41.4 with the changes from #132 - we can release a v4.1.4 targeting AutoMapper v10.1.1.

Not possible with v5 because this library targets AutoMapper v11.

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.

Enumerator not disposed when arbitrary projection is enumerated
2 participants