<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7319">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app: Remove silly usage of RAII_VAR.<br><br>Change-Id: Ideb594f7aae134974fb78d5477ba0853b97b8625<br>---<br>M main/app.c<br>1 file changed, 5 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/19/7319/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/app.c b/main/app.c<br>index 8ea6f82..04aca2b 100644<br>--- a/main/app.c<br>+++ b/main/app.c<br>@@ -3149,7 +3149,7 @@<br> <br> struct ast_mwi_state *ast_mwi_create(const char *mailbox, const char *context)<br> {<br>-    RAII_VAR(struct ast_mwi_state *, mwi_state, NULL, ao2_cleanup);<br>+      struct ast_mwi_state *mwi_state;<br> <br>   ast_assert(!ast_strlen_zero(mailbox));<br> <br>@@ -3159,6 +3159,7 @@<br>      }<br> <br>  if (ast_string_field_init(mwi_state, 256)) {<br>+         ao2_ref(mwi_state, -1);<br>               return NULL;<br>  }<br>     if (!ast_strlen_zero(context)) {<br>@@ -3167,7 +3168,6 @@<br>               ast_string_field_set(mwi_state, uniqueid, mailbox);<br>   }<br> <br>- ao2_ref(mwi_state, +1);<br>       return mwi_state;<br> }<br> <br>@@ -3340,8 +3340,8 @@<br>                                              struct stasis_message_type *message_type,<br>                                             struct ast_json *blob)<br> {<br>-    RAII_VAR(struct ast_mwi_blob *, obj, NULL, ao2_cleanup);<br>-     RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);<br>+   struct ast_mwi_blob *obj;<br>+    struct stasis_message *msg;<br> <br>        ast_assert(blob != NULL);<br> <br>@@ -3360,11 +3360,8 @@<br> <br>       /* This is not a normal MWI event.  Only used by the MinivmNotify app. */<br>     msg = stasis_message_create(message_type, obj);<br>-      if (!msg) {<br>-          return NULL;<br>- }<br>+    ao2_ref(obj, -1);<br> <br>- ao2_ref(msg, +1);<br>     return msg;<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7319">change 7319</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7319"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ideb594f7aae134974fb78d5477ba0853b97b8625 </div>
<div style="display:none"> Gerrit-Change-Number: 7319 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>