Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example: operations/composed_6: also free delay_timer_ #1505

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions asio/src/examples/cpp11/operations/composed_6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ struct async_write_message_initiation
// We no longer have any future work coming for the I/O executor.
io_work_.reset();

// Deallocate the encoded message before calling the user-supplied
// completion handler.
// Deallocate the encoded message and delay timer before calling the
// user-supplied completion handler.
encoded_message_.reset();
delay_timer_.reset();

// Call the user-supplied handler with the result of the operation.
handler_(error);
Expand Down
5 changes: 3 additions & 2 deletions asio/src/examples/cpp14/operations/composed_6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ auto async_write_messages(tcp::socket& socket,
// We no longer have any future work coming for the I/O executor.
io_work_.reset();

// Deallocate the encoded message before calling the user-supplied
// completion handler.
// Deallocate the encoded message and delay timer before calling the
// user-supplied completion handler.
encoded_message_.reset();
delay_timer_.reset();

// Call the user-supplied handler with the result of the operation.
handler_(error);
Expand Down
5 changes: 3 additions & 2 deletions asio/src/examples/cpp20/operations/composed_6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ auto async_write_messages(tcp::socket& socket,
// We no longer have any future work coming for the I/O executor.
io_work_.reset();

// Deallocate the encoded message before calling the user-supplied
// completion handler.
// Deallocate the encoded message and delay timer before calling the
// user-supplied completion handler.
encoded_message_.reset();
delay_timer_.reset();

// Call the user-supplied handler with the result of the operation.
handler_(error);
Expand Down