Diff between 0aa12f83777dfa392fdf6442689699a21aa696e6 and e3e4b3f1101fd5c9e568d446cc06fd512f964937

Changed Files

File Additions Deletions Status
src/shared/gatt-client.c +4 -0 modified

Full Patch

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 056f812..df994d7 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -2422,11 +2422,15 @@ static void execute_write_cb(uint8_t opcode, const void *pdu, uint16_t length,
 	} else if (opcode != BT_ATT_OP_EXEC_WRITE_RSP || pdu || length)
 		success = false;
 
+	bt_gatt_client_ref(op->client);
+
 	if (op->callback)
 		op->callback(success, op->reliable_error, att_ecode,
 								op->user_data);
 
 	start_next_long_write(op->client);
+
+	bt_gatt_client_unref(op->client);
 }
 
 static void complete_write_long_op(struct request *req, bool success,