File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -401,15 +401,17 @@ static void s_aws_ticket_wrapper_destroy(void *data) {
401401
402402 /* Capture all the pending reserves that are done (currently can only happen when request is canceled, which cancels
403403 * pending futures) */
404- while (! aws_linked_list_empty (& buffer_pool -> pending_reserves )) {
405- struct aws_linked_list_node * node = aws_linked_list_front (& buffer_pool -> pending_reserves );
404+ for ( struct aws_linked_list_node * node = aws_linked_list_begin (& buffer_pool -> pending_reserves );
405+ node != aws_linked_list_end (& buffer_pool -> pending_reserves );) {
406406 struct s3_pending_reserve * pending_reserve = AWS_CONTAINER_OF (node , struct s3_pending_reserve , node );
407+ struct aws_linked_list_node * current_node = node ;
408+ node = aws_linked_list_next (node );
407409
408410 if (aws_future_s3_buffer_ticket_is_done (pending_reserve -> ticket_future )) {
409411 AWS_FATAL_ASSERT (aws_future_s3_buffer_ticket_get_error (pending_reserve -> ticket_future ) != AWS_OP_SUCCESS );
410- aws_linked_list_pop_front ( & buffer_pool -> pending_reserves );
412+ aws_linked_list_remove ( current_node );
411413
412- aws_linked_list_push_back (& pending_nodes_to_remove , node );
414+ aws_linked_list_push_back (& pending_nodes_to_remove , current_node );
413415 }
414416 }
415417
You can’t perform that action at this time.
0 commit comments