Skip to content

Ensure correct disposal with using statement#1164

Merged
bergmeister merged 1 commit intoPowerShell:developmentfrom
bergmeister:CorrectDispose
Mar 5, 2019
Merged

Ensure correct disposal with using statement#1164
bergmeister merged 1 commit intoPowerShell:developmentfrom
bergmeister:CorrectDispose

Conversation

@bergmeister
Copy link
Collaborator

PR Summary

Instead of calling IDisposable.Dispose(), use using statement instead to ensure that Dispose always gets called.
Please use white-space ignoring diff due to the added indentation, some of the existing code looks sub-optimal but I only want to fix this problem where .Dispose() might get called.

PR Checklist

@bergmeister bergmeister marked this pull request as ready for review March 4, 2019 20:08
Copy link
Contributor

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

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

Much nicer

@bergmeister bergmeister merged commit 944c5be into PowerShell:development Mar 5, 2019
bergmeister added a commit to bergmeister/PSScriptAnalyzer that referenced this pull request Mar 5, 2019
@bergmeister bergmeister added this to the 1.18 milestone Mar 5, 2019
bergmeister added a commit to bergmeister/PSScriptAnalyzer that referenced this pull request Mar 22, 2019
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.

2 participants