Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 487872a5 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Andre Eisenbach
Browse files

Use dynamic memory for keeping GATT cache

Change-Id: I60674c47246d8fe2094fe78ce31b752fa2acb89e
parent 8282ef6a
Loading
Loading
Loading
Loading
+4 −11
Original line number Original line Diff line number Diff line
@@ -1038,12 +1038,8 @@ void bta_gattc_disc_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
    if (p_clcb->status != GATT_SUCCESS)
    if (p_clcb->status != GATT_SUCCESS)
    {
    {
        /* clean up cache */
        /* clean up cache */
        if(p_clcb->p_srcb && p_clcb->p_srcb->p_srvc_cache)
        if(p_clcb->p_srcb && p_clcb->p_srcb->p_srvc_cache) {
        {
            list_free(p_clcb->p_srcb->p_srvc_cache);
            while (! fixed_queue_is_empty(p_clcb->p_srcb->cache_buffer))
            {
                osi_freebuf(fixed_queue_try_dequeue(p_clcb->p_srcb->cache_buffer));
            }
            p_clcb->p_srcb->p_srvc_cache = NULL;
            p_clcb->p_srcb->p_srvc_cache = NULL;
        }
        }


@@ -1909,11 +1905,8 @@ void bta_gattc_process_api_refresh(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA * p_msg)
            }
            }
        }
        }
        /* in all other cases, mark it and delete the cache */
        /* in all other cases, mark it and delete the cache */
        if (p_srvc_cb->p_srvc_cache != NULL)
        if (p_srvc_cb->p_srvc_cache != NULL) {
        {
            list_free(p_srvc_cb->p_srvc_cache);
            while (! fixed_queue_is_empty(p_srvc_cb->cache_buffer))
                osi_freebuf(fixed_queue_try_dequeue(p_srvc_cb->cache_buffer));

            p_srvc_cb->p_srvc_cache = NULL;
            p_srvc_cb->p_srvc_cache = NULL;
        }
        }
    }
    }