Skip to content

Commit

Permalink
Fix transport tasks cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Jan 28, 2025
1 parent 29cdaa3 commit 8e71d5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/system/espidf/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ z_result_t z_task_cancel(_z_task_t *task) {
void _z_task_free(_z_task_t **task) {
z_free((*task)->join_event);
z_free(*task);
*task = NULL;
}

/*------------------ Mutex ------------------*/
Expand Down
1 change: 1 addition & 0 deletions src/system/rpi_pico/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ z_result_t _z_task_cancel(_z_task_t *task) {
void _z_task_free(_z_task_t **task) {
z_free((*task)->join_event);
z_free(*task);
*task = NULL;
}

/*------------------ Mutex ------------------*/
Expand Down
2 changes: 2 additions & 0 deletions src/transport/common/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void _z_common_transport_clear(_z_transport_common_t *ztc, bool detach_tasks) {
} else {
_z_task_join(ztc->_read_task);
}
_z_task_free(&ztc->_read_task);
z_free(ztc->_read_task);
ztc->_read_task = NULL;
}
Expand All @@ -39,6 +40,7 @@ void _z_common_transport_clear(_z_transport_common_t *ztc, bool detach_tasks) {
} else {
_z_task_join(ztc->_lease_task);
}
_z_task_free(&ztc->_lease_task);
z_free(ztc->_lease_task);
ztc->_lease_task = NULL;
}
Expand Down

0 comments on commit 8e71d5e

Please sign in to comment.