-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Win32 handle leak fix #11842
Win32 handle leak fix #11842
Conversation
@@ -133,6 +133,7 @@ std::string ResolvePath(const std::string &path) { | |||
int result = getFinalPathNameByHandleW(hFile, buf, BUF_SIZE - 1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); | |||
if (result >= BUF_SIZE || result == 0) | |||
wcscpy_s(buf, BUF_SIZE - 1, input.c_str()); | |||
CloseHandle(hFile); |
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.
Arg, oops. Thanks.
-[Unknown]
if (filePath_.empty()) { | ||
// Happens when workqueue tries to figure out priorities in PrioritizedWorkQueue::Pop(), | ||
// because priority() calls GetFileLoader()... gnarly. | ||
return fileLoader; |
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 remember that for some loaders, e.g. ones that involve memory caching or http access, the cost of tossing this in the bin and getting a new one a couple times is much higher. Ideally we shouldn't recreate just because that's easiest.
-[Unknown]
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.
Oops, put this comment in the wrong place somehow - was meant for the lifetime comment.
-[Unknown]
Fixes #11841 and likely fixes #11698.
Additionally, minor code cleanups.