Ensure connection timeout is freed when the connection is free

latest-fixes 0.4.12
Olivier Martin 2024-03-29 09:18:53 +01:00
parent 50dca02e97
commit 86f9a742f3
1 changed files with 6 additions and 0 deletions

View File

@ -299,6 +299,12 @@ void gattlib_connection_free(gatt_connection_t* connection) {
conn_context->on_handle_device_property_change_id = 0;
}
// Stop the timeout for connection
if (conn_context->connection_timeout_id) {
g_source_remove(conn_context->connection_timeout_id);
conn_context->connection_timeout_id = 0;
}
free(conn_context->device_object_path);
if (conn_context->device != NULL) {
g_object_unref(conn_context->device);