]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make certain ast_stopstream() sets the channel's stream members to NULL after closin...
authorBJ Weschke <bweschke@btwtech.com>
Tue, 2 May 2006 19:39:50 +0000 (19:39 +0000)
committerBJ Weschke <bweschke@btwtech.com>
Tue, 2 May 2006 19:39:50 +0000 (19:39 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@24295 65c4cc65-6c06-0410-ace0-fbb531ad65f3

file.c

diff --git a/file.c b/file.c
index 76bf9a12abbce1692ba4c0d4219d6ee15a4e438d..76d848f79334f51b4d1d453e94ba471f239e12d5 100644 (file)
--- a/file.c
+++ b/file.c
@@ -184,10 +184,13 @@ int ast_format_unregister(const char *name)
 int ast_stopstream(struct ast_channel *tmp)
 {
        /* Stop a running stream if there is one */
-       if (tmp->vstream)
+       if (tmp->vstream) {
                ast_closestream(tmp->vstream);
+               tmp->vstream = NULL;
+       }
        if (tmp->stream) {
                ast_closestream(tmp->stream);
+               tmp->stream = NULL;
                if (tmp->oldwriteformat && ast_set_write_format(tmp, tmp->oldwriteformat))
                        ast_log(LOG_WARNING, "Unable to restore format back to %d\n", tmp->oldwriteformat);
        }