Skip to content

Commit c45381d

Browse files
committed
Windows: Close Handle after Resolving Symlinks
Calling resolvePathSymlinks twice on the same path failed with a sharing exception due to the old handle still being help.
1 parent dee8d7b commit c45381d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ std::string SwiftLangSupport::resolvePathSymlinks(StringRef FilePath) {
859859

860860
DWORD success = GetFinalPathNameByHandleA(
861861
fileHandle, full_path, sizeof(full_path), FILE_NAME_NORMALIZED);
862+
CloseHandle(fileHandle);
862863
return (success ? full_path : InputPath);
863864
#endif
864865
}

0 commit comments

Comments
 (0)