8000 Add custom 'Selected.*' type to PSCustomObject in Select-Object only once by iSazonov · Pull Request #11548 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@iSazonov
Copy link
Collaborator
@iSazonov iSazonov commented Jan 10, 2020

PR Summary

Fix #11441

Before the fix Select-Object without parameters added custom 'Selected.' type to PSCustomObject even if this type was already present in TypeNames that was a memory leak in the edge case.
The cause of the problem was that Select-Object without parameters did not create a new object but forwarded the original.
The fix is to add custom 'Selected.
' type only if object is original and it has not already custom 'Selected.*' type.

PR Context

PR Checklist

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jan 10, 2020
@iSazonov iSazonov added this to the 7.1.0-preview.1 milestone Jan 10, 2020
@iSazonov iSazonov 7440 requested a review from SteveL-MSFT January 10, 2020 11:04
@iSazonov iSazonov self-assigned this Jan 10, 2020
@iSazonov iSazonov merged commit eb47c22 into PowerShell:master Jan 25, 2020
@iSazonov iSazonov deleted the fix-select-object-empty branch January 25, 2020 09:10
@ghost
Copy link
ghost commented Mar 26, 2020

🎉v7.1.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

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

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug in PS 5,6 and 7] Memory leak when Select-Object on $Global scope array of PSCustomObject

3 participants

0