]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Destroy the channel lock after the channel datastores.
authorRussell Bryant <russell@russellbryant.com>
Wed, 12 Mar 2008 16:59:07 +0000 (16:59 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 12 Mar 2008 16:59:07 +0000 (16:59 +0000)
(inspired by issue #12187)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108031 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index a12c4ef441e09bccd238c6572752e860eb60c391..e037d211d11a7a7700708657bce9f8d30f9980a6 100644 (file)
@@ -1223,7 +1223,6 @@ void ast_channel_free(struct ast_channel *chan)
        if (chan->pbx)
                ast_log(LOG_WARNING, "PBX may not have been terminated properly on '%s'\n", chan->name);
        free_cid(&chan->cid);
-       ast_mutex_destroy(&chan->lock);
        /* Close pipes if appropriate */
        if ((fd = chan->alertpipe[0]) > -1)
                close(fd);
@@ -1250,6 +1249,8 @@ void ast_channel_free(struct ast_channel *chan)
 
        /* Destroy the jitterbuffer */
        ast_jb_destroy(chan);
+       
+       ast_mutex_destroy(&chan->lock);
 
        ast_string_field_free_memory(chan);
        free(chan);