]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
report the actual channel number that was unregistered, instead of assuming that...
authorKevin P. Fleming <kpfleming@digium.com>
Thu, 23 Aug 2007 17:08:25 +0000 (17:08 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Thu, 23 Aug 2007 17:08:25 +0000 (17:08 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80501 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 6c096708197a927a7d24637f9f088bead1390d77..5a107f242d2c389b080f3c7ac9502075dbca34d2 100644 (file)
@@ -10304,8 +10304,9 @@ static int action_zapshowchannels(struct mansession *s, const struct message *m)
 
 static int __unload_module(void)
 {
-       int x = 0;
+       int x;
        struct zt_pvt *p, *pl;
+
 #ifdef HAVE_PRI
        int i;
        for (i = 0; i < NUM_SPANS; i++) {
@@ -10354,7 +10355,7 @@ static int __unload_module(void)
                        zt_close(p->subs[SUB_REAL].zfd);
                pl = p;
                p = p->next;
-               x++;
+               x = pl->channel;
                /* Free associated memory */
                if (pl)
                        destroy_zt_pvt(&pl);