<p>Richard Mudgett <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/7454">View Change</a></p><p>Patch set 3:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p>(3 comments)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/7454/3/main/asterisk.c">File main/asterisk.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7454/3/main/asterisk.c@4645">Patch Set #3, Line 4645:</a> <code style="font-family:monospace,monospace">    ast_sounds_reindex();</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">check_init(ast_sounds_reindex(), "First sounds index");</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/7454/3/main/sounds_index.c">File main/sounds_index.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7454/3/main/sounds_index.c@299">Patch Set #3, Line 299:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (ast_sounds_reindex()) {<br>           return -1;<br>    }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">We can get away with not indexing the sounds now.  Otherwise we will always index the sounds twice.  Once here and once just before fully booted.</p><p style="white-space: pre-wrap; word-wrap: break-word;">show_sound_info_cb() is the only place that doesn't check for a NULL after calling ast_sounds_get_index().  This is done for a CLI command so it doesn't really matter much.</p><p style="white-space: pre-wrap; word-wrap: break-word;">The other places that call ast_sounds_get_index() are for ARI.  Those places check for a NULL return value and I don't think we even allow ARI activity until fully booted anyway.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7454/3/main/sounds_index.c@335">Patch Set #3, Line 335:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">      ao2_ref(sounds_index, +1);<br>    return sounds_index;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Heh.  ast_sounds_get_index() documents it returns NULL on failure but we'll crash instead. :)</p><p style="white-space: pre-wrap; word-wrap: break-word;">return ao2_bump(sounds_index);</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/7454">change 7454</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/7454"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I585fd6ee04200612ab1490dc804f76805f89cf0a </div>
<div style="display:none"> Gerrit-Change-Number: 7454 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 06 Dec 2017 23:25:29 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>