diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-09 05:12:07 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-09 05:12:07 +0000 |
commit | aec772a0cdec34611b9ccf391a9e94872676bd44 (patch) | |
tree | ded0b3fba386ba34baa7c1acac14414477e484e2 /main/file.c | |
parent | d4bc9ad4e3cb8ca524bc1d62d87bd1355d8f92de (diff) |
Merged revisions 187302 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r187302 | tilghman | 2009-04-08 23:59:05 -0500 (Wed, 08 Apr 2009) | 14 lines
Merged revisions 187300-187301 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r187300 | tilghman | 2009-04-08 23:31:38 -0500 (Wed, 08 Apr 2009) | 3 lines
Add debugging mode for diagnosing file descriptor leaks.
(Related to issue #14625)
........
r187301 | tilghman | 2009-04-08 23:32:40 -0500 (Wed, 08 Apr 2009) | 2 lines
Oops, missed this file in the last commit.
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@187303 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/file.c')
-rw-r--r-- | main/file.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/main/file.c b/main/file.c index 05f6ea6f6..ac47b2b51 100644 --- a/main/file.c +++ b/main/file.c @@ -314,8 +314,10 @@ static void filestream_destructor(void *arg) free(f->filename); if (f->realfilename) free(f->realfilename); - if (f->fmt->close) - f->fmt->close(f); + if (f->fmt->close) { + void (*closefn)(struct ast_filestream *) = f->fmt->close; + closefn(f); + } if (f->f) fclose(f->f); if (f->vfs) @@ -353,8 +355,9 @@ static int fn_wrapper(struct ast_filestream *s, const char *comment, enum wrap_f { struct ast_format *f = s->fmt; int ret = -1; + int (*openfn)(struct ast_filestream *s); - if (mode == WRAP_OPEN && f->open && f->open(s)) + if (mode == WRAP_OPEN && (openfn = f->open) && openfn(s)) ast_log(LOG_WARNING, "Unable to open format %s\n", f->name); else if (mode == WRAP_REWRITE && f->rewrite && f->rewrite(s, comment)) ast_log(LOG_WARNING, "Unable to rewrite format %s\n", f->name); |