Skip to content

Commit dabe18d

Browse files
authored
Merge pull request #9605 from tinysun212/pr-no-freelibrary
[stdlib] Fixed image inspection for Win32
2 parents 1bafc98 + 3ae4c7b commit dabe18d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stdlib/public/runtime/ImageInspectionWin32.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ static int _addImageCallback(struct _swift_dl_phdr_info *info,
185185
if (conformances)
186186
inspectArgs->fnAddImageBlock(conformances, conformancesSize);
187187

188-
#if defined(_WIN32)
189-
FreeLibrary(handle);
190-
#else
188+
// There is no close function or free function for GetModuleHandle(),
189+
// especially we should not pass a handle returned by GetModuleHandle to the
190+
// FreeLibrary function.
191+
#if defined(__CYGWIN__)
191192
dlclose(handle);
192193
#endif
193194
return 0;

0 commit comments

Comments
 (0)