fix(executor): close_uv when future ready

This commit is contained in:
LongYinan 2020-04-01 23:36:19 +08:00
parent b0db6f3070
commit d0eadec77b
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -96,12 +96,12 @@ unsafe extern "C" fn poll_future(handle: *mut sys::uv_async_t) {
let mut task = Arc::from_raw(data_ptr);
if let Some(mut_task) = Arc::get_mut(&mut task) {
if mut_task.poll_future() {
Arc::into_raw(task);
} else {
sys::uv_close(
handle as *mut sys::uv_handle_t,
Some(drop_handle_after_close),
);
} else {
Arc::into_raw(task);
};
} else {
Arc::into_raw(task);