Skip to content

Commit

Permalink
fix issue when dropping DeviceManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Xoffio committed Sep 30, 2024
1 parent 38ef99d commit 542f7c9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frida/src/device_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ impl<'a> DeviceManager<'a> {

impl<'a> Drop for DeviceManager<'a> {
fn drop(&mut self) {
unsafe { frida_sys::frida_unref(self.manager_ptr as _) }
let mut error: *mut frida_sys::GError = std::ptr::null_mut();
unsafe {
frida_sys::frida_device_manager_close_sync(
self.manager_ptr,
std::ptr::null_mut(),
&mut error,
);
frida_sys::frida_unref(self.manager_ptr as _)
}
}
}

0 comments on commit 542f7c9

Please sign in to comment.