<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10227">View Change</a></p><p>5 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10227/2/include/asterisk/stasis_bridges.h">File include/asterisk/stasis_bridges.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10227/2/include/asterisk/stasis_bridges.h@73">Patch Set #2, Line 73:</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;">* \since 13.24<br> * \since 15.6<br> * \since 16.1<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Still here :-)</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10227/2/main/stasis_bridges.c">File main/stasis_bridges.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10227/2/main/stasis_bridges.c@296">Patch Set #2, Line 296:</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;"> update->old_snapshot = old;<br> update->new_snapshot = new;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Since you are calling ao2_cleanup on these in the destructor these should probably get a ref bump here at assignment.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10227/2/main/stasis_bridges.c@383">Patch Set #2, Line 383:</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(update, -1);<br> if (!msg) {<br> return;<br> }<br><br> /* The link of the new automatically replaces the old */<br> ao2_link(bridge_cache, new_snapshot);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">If I am tracing the code right, then new_snapshot currently has a single ref (update_create doesn't currently bump it). As does 'update'. Update gets unref'd, the destructor is called and new_snapshot gets cleaned up in update's destructor. Then it gets linked, but at this point it seems like it has been potentially destroyed?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10227/2/main/stasis_bridges.c@1374">Patch Set #2, Line 1374:</a> <code style="font-family:monospace,monospace"> * \since 12.0.0</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Delete this line</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10227/2/main/stasis_bridges.c@1412">Patch Set #2, Line 1412:</a> <code style="font-family:monospace,monospace"> * \since 12.0.0</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Remove this line too.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10227">change 10227</a>. To unsubscribe, or for help writing mail filters, 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/10227"/><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: I7049b80efa88676ce5c4666f818fa18ad1985369 </div>
<div style="display:none"> Gerrit-Change-Number: 10227 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 26 Sep 2018 15:21:57 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>