Skip to content

Commit f4f75ce

Browse files
committed
Revert "Don't try to free DLL on drop (rust-lang#1089)"
This reverts commit a6a928e. Fix rust-lang CI
1 parent 748b777 commit f4f75ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/windows/find_tools.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ mod impl_ {
225225
use crate::windows::setup_config::SetupConfiguration;
226226
use crate::windows::vs_instances::{VsInstances, VswhereInstance};
227227
use crate::windows::windows_sys::{
228-
GetMachineTypeAttributes, GetProcAddress, LoadLibraryA, UserEnabled, HMODULE,
228+
FreeLibrary, GetMachineTypeAttributes, GetProcAddress, LoadLibraryA, UserEnabled, HMODULE,
229229
IMAGE_FILE_MACHINE_AMD64, MACHINE_ATTRIBUTES, S_OK,
230230
};
231231
use std::convert::TryFrom;
@@ -273,6 +273,12 @@ mod impl_ {
273273
}
274274
}
275275

276+
impl Drop for LibraryHandle {
277+
fn drop(&mut self) {
278+
unsafe { FreeLibrary(self.0) };
279+
}
280+
}
281+
276282
type GetMachineTypeAttributesFuncType =
277283
unsafe extern "system" fn(u16, *mut MACHINE_ATTRIBUTES) -> i32;
278284
const _: () = {

0 commit comments

Comments
 (0)