Skip to content

Commit

Permalink
Add error handling for ReleaseCapture
Browse files Browse the repository at this point in the history
  • Loading branch information
teddemunnik committed Mar 21, 2020
1 parent 3950da2 commit fe40741
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion druid-shell/src/platform/windows/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,12 @@ impl WndState {
self.captured_mouse_buttons &= !(1 << (button as u32));
if self.captured_mouse_buttons == 0 {
unsafe {
ReleaseCapture();
if ReleaseCapture() == FALSE {
warn!(
"failed to release mouse capture: {}",
Error::Hr(HRESULT_FROM_WIN32(GetLastError()))
);
}
}
}
}
Expand Down

0 comments on commit fe40741

Please sign in to comment.