abstract_jb: Remove silly usage of RAII_VAR.
authorCorey Farrell <git@cfware.com>
Thu, 16 Nov 2017 18:55:14 +0000 (13:55 -0500)
committerCorey Farrell <git@cfware.com>
Mon, 20 Nov 2017 20:03:25 +0000 (14:03 -0600)
Change-Id: I9d56175369363d1dc735504cf78a3a5577069f49

main/abstract_jb.c

index 0f0e661..b375739 100644 (file)
@@ -443,7 +443,7 @@ static int create_jb(struct ast_channel *chan, struct ast_frame *frr)
 
        /* Create a frame log file */
        if (ast_test_flag(jbconf, AST_JB_LOG)) {
-               RAII_VAR(struct ast_channel *, bridged, ast_channel_bridge_peer(chan), ast_channel_cleanup);
+               struct ast_channel *bridged = ast_channel_bridge_peer(chan);
                char safe_logfile[30] = "/tmp/logfile-XXXXXX";
                int safe_fd;
 
@@ -479,6 +479,8 @@ static int create_jb(struct ast_channel *chan, struct ast_frame *frr)
                        jb_framelog("JB_PUT_FIRST {now=%ld}: Dropped frame with ts=%ld and len=%ld\n",
                                now, frr->ts, frr->len);
                }
+
+               ast_channel_cleanup(bridged);
        }
 
        ast_verb(3, "%s jitterbuffer created on channel %s\n", jbimpl->name, ast_channel_name(chan));