Reset the use_count to zero in chan_free
It is possible that the BTS is closing the channel even when
our upper layers are doing work. Reset the use_count add a fixme
to call cancellations for pending operations. Cancellation of the
call state (state machines in general) and such come into mind...
diff --git a/src/chan_alloc.c b/src/chan_alloc.c
index b50b19f..307072f 100644
--- a/src/chan_alloc.c
+++ b/src/chan_alloc.c
@@ -193,6 +193,11 @@
lchan->subscr = 0;
}
+ /* We might kill an active channel... FIXME: call cancellations */
+ if (lchan->use_count != 0) {
+ lchan->use_count = 0;
+ }
+
/* stop the timer */
del_timer(&lchan->release_timer);