diff --git a/src/shared/att.c b/src/shared/att.c
index 503e06c..c70d396 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
return false;
if (att->pending_req && att->pending_req->id == id) {
- op = att->pending_req;
- att->pending_req = NULL;
- goto done;
+ /* Don't cancel the pending request; remove it's handlers */
+ att->pending_req->callback = NULL;
+ att->pending_req->destroy = NULL;
+ return true;
}
if (att->pending_ind && att->pending_ind->id == id) {
- op = att->pending_ind;
- att->pending_ind = NULL;
- goto done;
+ /* Don't cancel the pending indication; remove it's handlers */
+ att->pending_ind->callback = NULL;
+ att->pending_ind->destroy = NULL;
+ return true;
}
op = queue_remove_if(att->req_queue, match_op_id, UINT_TO_PTR(id));
queue_remove_all(att->write_queue, NULL, NULL, destroy_att_send_op);
if (att->pending_req) {
- destroy_att_send_op(att->pending_req);
- att->pending_req = NULL;
+ /* Don't cancel the pending request; remove it's handlers */
+ att->pending_req->callback = NULL;
+ att->pending_req->destroy = NULL;
}
if (att->pending_ind) {
- destroy_att_send_op(att->pending_ind);
- att->pending_ind = NULL;
+ /* Don't cancel the pending indication; remove it's handlers */
+ att->pending_ind->callback = NULL;
+ att->pending_ind->destroy = NULL;
}
return true;