X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=stack%2Fsdp%2Fsdp_main.c;h=8c6c6126ed8beac47b2a1d7c30981f49a7340eae;hb=486d27733fd3db14575370985ae50a02cbb193d4;hp=c888817992c59c5f168577135d90fd4049c5986a;hpb=42e54009d789b5cae6df4599013852a52c1079a1;p=android-x86%2Fsystem-bt.git diff --git a/stack/sdp/sdp_main.c b/stack/sdp/sdp_main.c index c88881799..8c6c6126e 100644 --- a/stack/sdp/sdp_main.c +++ b/stack/sdp/sdp_main.c @@ -85,6 +85,10 @@ void sdp_init (void) /* Clears all structures and local SDP database (if Server is enabled) */ memset (&sdp_cb, 0, sizeof (tSDP_CB)); + for (int i = 0; i < SDP_MAX_CONNECTIONS; i++) { + sdp_cb.ccb[i].sdp_conn_timer = alarm_new("sdp.sdp_conn_timer"); + } + /* Initialize the L2CAP configuration. We only care about MTU and flush */ sdp_cb.l2cap_my_cfg.mtu_present = TRUE; sdp_cb.l2cap_my_cfg.mtu = SDP_MTU_SIZE; @@ -139,6 +143,13 @@ void sdp_init (void) } } +void sdp_free(void) { + for (int i = 0; i < SDP_MAX_CONNECTIONS; i++) { + alarm_free(sdp_cb.ccb[i].sdp_conn_timer); + sdp_cb.ccb[i].sdp_conn_timer = NULL; + } +} + #if (defined(SDP_DEBUG) && SDP_DEBUG == TRUE) /******************************************************************************* **