fix(executor): close_uv when future ready
This commit is contained in:
parent
b0db6f3070
commit
d0eadec77b
1 changed files with 2 additions and 2 deletions
|
@ -96,12 +96,12 @@ unsafe extern "C" fn poll_future(handle: *mut sys::uv_async_t) {
|
||||||
let mut task = Arc::from_raw(data_ptr);
|
let mut task = Arc::from_raw(data_ptr);
|
||||||
if let Some(mut_task) = Arc::get_mut(&mut task) {
|
if let Some(mut_task) = Arc::get_mut(&mut task) {
|
||||||
if mut_task.poll_future() {
|
if mut_task.poll_future() {
|
||||||
Arc::into_raw(task);
|
|
||||||
} else {
|
|
||||||
sys::uv_close(
|
sys::uv_close(
|
||||||
handle as *mut sys::uv_handle_t,
|
handle as *mut sys::uv_handle_t,
|
||||||
Some(drop_handle_after_close),
|
Some(drop_handle_after_close),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
Arc::into_raw(task);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
Arc::into_raw(task);
|
Arc::into_raw(task);
|
||||||
|
|
Loading…
Reference in a new issue