Skip to content

Commit

Permalink
Merge pull request #700 from ecoal95/querydevice-leak
Browse files Browse the repository at this point in the history
x11: Prevent leak on XIQueryDevice
  • Loading branch information
tomaka committed Jan 7, 2016
2 parents 64dbf51 + 21b9245 commit 88e64a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/x11/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl XInputEventHandler {
for axis_id in 0..axis_state.mask_len {
if ffi::XIMaskIsSet(&mask, axis_id) {
let axis_value = unsafe{*axis_state.values.offset(axis_count)};
let delta = calc_scroll_deltas(event_data, axis_id, axis_value, &self.axis_list,
let delta = calc_scroll_deltas(event_data, axis_id, axis_value, &self.axis_list,
&mut self.current_state.axis_values);
scroll_delta.0 += delta.0;
scroll_delta.1 += delta.1;
Expand Down Expand Up @@ -314,7 +314,11 @@ fn read_input_axis_info(display: &Arc<XConnection>) -> Vec<Axis> {
}
}
}


unsafe {
(display.xinput2.XIFreeDeviceInfo)(devices);
}

axis_list
}

Expand Down

0 comments on commit 88e64a8

Please sign in to comment.