FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add custom 'Selected.*' type to PSCustomObject in Select-Object only once by iSazonov · Pull Request #11548 · PowerShell/PowerShell · GitHub

Add custom 'Selected.*' type to PSCustomObject in Select-Object only once - #11548

Merged
Ilya (iSazonov) merged 2 commits into
PowerShell:masterfrom
iSazonov:fix-select-object-empty
Jan 25, 2020
Merged

Add custom 'Selected.*' type to PSCustomObject in Select-Object only once#11548
Ilya (iSazonov) merged 2 commits into
PowerShell:masterfrom
iSazonov:fix-select-object-empty

Conversation

Ilya (iSazonov) commented Jan 10, 2020
edited
Loading

Copy link
Copy Markdown
Collaborator

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

Ilya (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
Ilya (iSazonov) added this to the 7.1.0-preview.1 milestone Jan 10, 2020
Ilya (iSazonov) self-assigned this Jan 10, 2020
Ilya (iSazonov) merged commit eb47c22 into PowerShell:master Jan 25, 2020
Ilya (iSazonov) deleted the fix-select-object-empty branch January 25, 2020 09:10

Copy link
Copy Markdown

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

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
…once (PowerShell#11548)

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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL