[Asterisk-code-review] cli: Remove silly usage of RAII VAR. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Tue Nov 21 07:55:04 CST 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/7325 )

Change subject: cli: Remove silly usage of RAII_VAR.
......................................................................

cli: Remove silly usage of RAII_VAR.

Change-Id: I81aacfee7cd26e4fc5eef07bca582700c2975bd7
---
M main/cli.c
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/main/cli.c b/main/cli.c
index 64882a3..f2316d6 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -959,7 +959,7 @@
 #define VERBOSE_FORMAT_STRING  "%-20.20s %-20.20s %-16.16s %4d %-7.7s %-12.12s %-25.25s %-15.15s %8.8s %-11.11s %-11.11s %-20.20s\n"
 #define VERBOSE_FORMAT_STRING2 "%-20.20s %-20.20s %-16.16s %-4.4s %-7.7s %-12.12s %-25.25s %-15.15s %8.8s %-11.11s %-11.11s %-20.20s\n"
 
-	RAII_VAR(struct ao2_container *, channels, NULL, ao2_cleanup);
+	struct ao2_container *channels;
 	struct ao2_iterator it_chans;
 	struct stasis_message *msg;
 	int numchans = 0, concise = 0, verbose = 0, count = 0;
@@ -1073,6 +1073,7 @@
 
 		ast_cli(a->fd, "%d call%s processed\n", ast_processed_calls(), ESS(ast_processed_calls()));
 	}
+	ao2_ref(channels, -1);
 
 	return CLI_SUCCESS;
 
@@ -1666,7 +1667,7 @@
 char *ast_complete_channels(const char *line, const char *word, int pos, int state, int rpos)
 {
 	int wordlen = strlen(word), which = 0;
-	RAII_VAR(struct ao2_container *, cached_channels, NULL, ao2_cleanup);
+	struct ao2_container *cached_channels;
 	char *ret = NULL;
 	struct ao2_iterator iter;
 	struct stasis_message *msg;
@@ -1690,6 +1691,7 @@
 		}
 	}
 	ao2_iterator_destroy(&iter);
+	ao2_ref(cached_channels, -1);
 
 	return ret;
 }

-- 
To view, visit https://gerrit.asterisk.org/7325
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I81aacfee7cd26e4fc5eef07bca582700c2975bd7
Gerrit-Change-Number: 7325
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171121/720b5d49/attachment.html>


More information about the asterisk-code-review mailing list