parent
72416e814e
commit
7f1604fdaf
@ -15,7 +15,7 @@ UVW_INLINE void work_req::work_callback(uv_work_t *req) {
|
||||
static_cast<work_req *>(req->data)->func();
|
||||
}
|
||||
|
||||
UVW_INLINE void work_req::after_work_callback(uv_work_t *req, int status) {
|
||||
UVW_INLINE void work_req::after_work_callback(uv_work_t* req, int status) {
|
||||
if(auto ptr = reserve(req); status) {
|
||||
ptr->publish(error_event{status});
|
||||
} else {
|
||||
@ -24,8 +24,9 @@ UVW_INLINE void work_req::after_work_callback(uv_work_t *req, int status) {
|
||||
}
|
||||
|
||||
UVW_INLINE void work_req::queue() {
|
||||
// uv_queue_work only returns an error if the callback is null which is not the case here
|
||||
this->leak_if(uv_queue_work(parent().raw(), raw(), &work_callback, &after_work_callback));
|
||||
if(auto err = this->leak_if(uv_queue_work(parent().raw(), raw(), &work_callback, &after_work_callback)); err != 0) {
|
||||
publish(error_event{err});
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace uvw
|
||||
|
||||
Loading…
Reference in New Issue
Block a user