Skip to content

Commit

Permalink
Fixed handling error from creating error mode guard
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonwieloch committed Sep 6, 2017
1 parent abf2b94 commit 8c6b53e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/raw/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub unsafe fn get_sym(handle: Handle, name: &CStr) -> Result<*mut (), Error> {
#[inline]
pub unsafe fn open_lib(name: &OsStr) -> Result<Handle, Error> {
let wide_name: Vec<u16> = name.encode_wide().chain(Some(0)).collect();
let _guard = ErrorModeGuard::new();
let _guard = ErrorModeGuard::new()?;
let handle = kernel32::LoadLibraryW(wide_name.as_ptr());
if handle.is_null() {
Err(Error::OpeningLibraryError(get_win_error()))
Expand Down

0 comments on commit 8c6b53e

Please sign in to comment.