Skip to content

Commit

Permalink
use adapter/connection in termination callback
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Aug 16, 2023
1 parent 6177a5a commit 9d9778a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions source/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ static void s_mqtt_client_shutdown(
}

/* TODO Call termination callback */
connection->on_termination(connection, connection->on_termination_ud);

/* The connection can die now. Release the refcount */
aws_mqtt_client_connection_release(&connection->base);
Expand Down
2 changes: 1 addition & 1 deletion source/v5/mqtt5_to_mqtt3_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static void s_mqtt_adapter_final_destroy_task_fn(struct aws_task *task, void *ar

/* trigger the termination callback */
if (adapter->on_termination) {
adapter->on_termination(NULL, adapter->on_termination_user_data);
adapter->on_termination(adapter, adapter->on_termination_user_data);
adapter->on_termination = NULL;
adapter->on_termination_user_data = NULL;
}
Expand Down

0 comments on commit 9d9778a

Please sign in to comment.