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
Fix FolderNameEditor memory leak on cancel #769
Conversation
c396653
to
b7a8dd4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The double pointer on SHGetPathFromIDList looks suspicious.
src/System.Windows.Forms.Design.Editors/src/Misc/UnsafeNativeMethods.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design.Editors/src/Misc/UnsafeNativeMethods.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design.Editors/src/System/Windows/Forms/Design/FolderNameEditor.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design.Editors/src/System/Windows/Forms/Design/FolderNameEditor.cs
Outdated
Show resolved
Hide resolved
@JeremyKuhne would you mind taking a look at this one as well? |
Reviewing... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for digging into this! Added a few more comments.
src/System.Windows.Forms.Design.Editors/src/System/Windows/Forms/Design/FolderNameEditor.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design.Editors/src/System/Windows/Forms/Design/FolderNameEditor.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/FolderBrowserDialog.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/FolderBrowserDialog.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design.Editors/src/System/Windows/Forms/Design/FolderNameEditor.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/FileDialogCustomPlace.cs
Show resolved
Hide resolved
d4f9a2c
to
f65f9f8
Compare
Codecov Report
@@ Coverage Diff @@
## master #769 +/- ##
===================================================
+ Coverage 26.24093% 26.25141% +0.01048%
===================================================
Files 1054 1057 +3
Lines 287909 287916 +7
Branches 38463 38461 -2
===================================================
+ Hits 75550 75582 +32
+ Misses 208380 208350 -30
- Partials 3979 3984 +5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hughbe!
} | ||
finally | ||
{ | ||
ArrayPool<char>.Shared.Return(displayName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note for future reference. In scenarios where perf is more critical and you don't expect errors to frequently happen it is ok to not return arrays to the pool (i.e. don't need to introduce a try block).
Thanks @hughbe and @JeremyKuhne ! |
Fixes #768
Fixes #770
Fixes #767