We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a08702 commit 34b9e76Copy full SHA for 34b9e76
src/sys/linux.rs
@@ -37,6 +37,7 @@ pub struct Mouse {
37
#[link(name = "xdo")]
38
extern "C" {
39
fn xdo_new(display: *const c_char) -> XDO;
40
+ fn xdo_free(xdo: XDO);
41
42
fn xdo_move_mouse(xdo: XDO, x: c_int, y: c_int, screen: c_int) -> c_int;
43
fn xdo_mouse_down(xdo: XDO, window: WINDOW, button: c_int);
@@ -102,3 +103,11 @@ impl Mouse {
102
103
Ok(())
104
}
105
106
+
107
+impl Drop for Mouse {
108
+ fn drop(&mut self) {
109
+ unsafe {
110
+ xdo_free(self.xdo);
111
+ }
112
113
+}
0 commit comments