<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7903">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stasis_system: Remove silly usage of RAII_VAR.<br><br>Change-Id: Iedbe5656cee68cd3a96a953558764aa02d4a0c3b<br>---<br>M main/stasis_system.c<br>1 file changed, 10 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/03/7903/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/stasis_system.c b/main/stasis_system.c<br>index 67970bd..4b2963c 100644<br>--- a/main/stasis_system.c<br>+++ b/main/stasis_system.c<br>@@ -119,9 +119,9 @@<br> <br> void ast_system_publish_registry(const char *channeltype, const char *username, const char *domain, const char *status, const char *cause)<br> {<br>- RAII_VAR(struct ast_json *, registry, NULL, ast_json_unref);<br>- RAII_VAR(struct ast_json_payload *, payload, NULL, ao2_cleanup);<br>- RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);<br>+ struct ast_json *registry;<br>+ struct ast_json_payload *payload;<br>+ struct stasis_message *message;<br> <br> if (!ast_system_registry_type()) {<br> return;<br>@@ -135,15 +135,20 @@<br> "status", status,<br> "cause", S_OR(cause, ""));<br> <br>- if (!(payload = ast_json_payload_create(registry))) {<br>+ payload = ast_json_payload_create(registry);<br>+ ast_json_unref(registry);<br>+ if (!payload) {<br> return;<br> }<br> <br>- if (!(message = stasis_message_create(ast_system_registry_type(), payload))) {<br>+ message = stasis_message_create(ast_system_registry_type(), payload);<br>+ ao2_ref(payload, -1);<br>+ if (!message) {<br> return;<br> }<br> <br> stasis_publish(ast_system_topic(), message);<br>+ ao2_ref(message, -1);<br> }<br> <br> static struct ast_manager_event_blob *system_registry_to_ami(struct stasis_message *message)<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7903">change 7903</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/7903"/><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: Iedbe5656cee68cd3a96a953558764aa02d4a0c3b </div>
<div style="display:none"> Gerrit-Change-Number: 7903 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>