Skip to content

Commit

Permalink
fix loop
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Oct 10, 2024
1 parent cd2d0f2 commit 4cda6e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/darwin/dispatch_queue_event_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ static void s_destroy(struct aws_event_loop *event_loop) {
aws_mutex_lock(&dispatch_loop->synced_data.lock);
// The entry in the scheduled_services are all pushed to dispatch loop as the function context.
// Apple does not allow NULL context here, do not destroy the entry until the block run.
struct aws_linked_list scheduled_list = dispatch_loop->synced_data.scheduling_state.scheduled_services;
for (struct aws_linked_list_node *iter = aws_linked_list_begin(&scheduled_list);
iter != aws_linked_list_end(&scheduled_list);
struct aws_linked_list_node *iter = NULL;
for (iter = aws_linked_list_begin(&dispatch_loop->synced_data.scheduling_state.scheduled_services);
iter != aws_linked_list_end(&dispatch_loop->synced_data.scheduling_state.scheduled_services);
iter = aws_linked_list_next(iter)) {
struct scheduled_service_entry *entry = AWS_CONTAINER_OF(iter, struct scheduled_service_entry, node);
entry->cancel = true;
Expand Down

0 comments on commit 4cda6e1

Please sign in to comment.