Cancel hosted events before unregistering hosted entity

This commit is contained in:
Andrei Alexeyev 2020-05-02 01:18:09 +03:00
parent b7a855c323
commit 556ba2ee6f
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4

View file

@ -370,17 +370,17 @@ static void cotask_finalize(CoTask *task) {
cancel_task_events(task_data);
if(task_data->hosted.ent) {
ent_unregister(task_data->hosted.ent);
task_data->hosted.ent = NULL;
}
if(task_data->hosted.events) {
_coevent_array_action(task_data->hosted.num_events, task_data->hosted.events, coevent_cancel);
task_data->hosted.events = NULL;
task_data->hosted.num_events = 0;
}
if(task_data->hosted.ent) {
ent_unregister(task_data->hosted.ent);
task_data->hosted.ent = NULL;
}
if(task_data->wait.wait_type == COTASK_WAIT_EVENT) {
CoEvent *evt = NOT_NULL(task_data->wait.event.pevent);