From f350e253948527290e78748a270dcf1613b1271c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 26 Aug 2011 07:55:26 +0200 Subject: lapd: stop timers in lapd_instance_free() --- src/input/lapd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/input/lapd.c b/src/input/lapd.c index d94af58..be011af 100644 --- a/src/input/lapd.c +++ b/src/input/lapd.c @@ -733,6 +733,17 @@ struct lapd_instance *lapd_instance_alloc(int network_side, void lapd_instance_free(struct lapd_instance *li) { + struct lapd_tei *lt; + + /* make sure to terminate any pending timers */ + llist_for_each_entry(lt, &li->tei_list, list) { + struct lapd_sap *sap; + llist_for_each_entry(sap, <->sap_list, list) { + if (osmo_timer_pending(&sap->sabme_timer)) + osmo_timer_del(&sap->sabme_timer); + } + } + /* tei and sapis are allocated hierarchically of the lapd * instance, so one free is sufficient here */ talloc_free(li); -- cgit v1.2.3-55-g7522