From 65229df5ba62ebed4189b8cf89602d1ad47c1eb8 Mon Sep 17 00:00:00 2001 From: Bret Ambrose Date: Fri, 19 Jan 2024 14:58:54 -0800 Subject: [PATCH] Explanation why we use new approach --- include/aws/mqtt/private/request-response/weak_ref.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/aws/mqtt/private/request-response/weak_ref.h b/include/aws/mqtt/private/request-response/weak_ref.h index 42a96764..cff0a2d8 100644 --- a/include/aws/mqtt/private/request-response/weak_ref.h +++ b/include/aws/mqtt/private/request-response/weak_ref.h @@ -26,6 +26,10 @@ * eventstream RPC connection. We use a single weak ref to the protocol adapter and zero its opaque value when * the protocol adapter is destroyed. Operation callbacks that subsequently resolve can then short circuit and do * nothing rather than call into garbage and crash. + * + * We use this rather than explicitly tracking and zeroing all pending operations (like the 3-to-5 adapter does) + * because this approach is simpler and our usage does not require any of these callbacks to be invoked once the + * request-response client is destroyed. */ struct aws_weak_ref;