<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13675">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_stasis: trigger cleanup after update<br><br>The cleanup code in stasis shuts down applications if they are in a deactivated<br>state, and no longer have explicit subscriptions. When registering an app the<br>cleanup code was running before calling 'update'. When it should be executed<br>after 'update' since a call to register may re-activate the app. We don't want<br>it to shutdown before the 'update' otherwise the app won't be re-activated,<br>or registered.<br><br>This patch makes it so the cleanup code is executed post 'update'.<br><br>ASTERISK-28679 #close<br><br>Change-Id: I8f2c0b17e33bb8128441567b97fd4c7bf74a327b<br>---<br>M res/res_stasis.c<br>1 file changed, 3 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/75/13675/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_stasis.c b/res/res_stasis.c</span><br><span>index 04b10ef..384b3b1 100644</span><br><span>--- a/res/res_stasis.c</span><br><span>+++ b/res/res_stasis.c</span><br><span>@@ -1718,9 +1718,9 @@</span><br><span>                * prevent the possibility of a deadlock with the session.  We'll still</span><br><span>           * run the lazy cleanup first though.</span><br><span>                 */</span><br><span style="color: hsl(0, 100%, 40%);">-             cleanup();</span><br><span>           ao2_unlock(apps_registry);</span><br><span>           app_update(app, handler, data);</span><br><span style="color: hsl(120, 100%, 40%);">+               cleanup();</span><br><span>           return 0;</span><br><span>    }</span><br><span> </span><br><span>@@ -1745,11 +1745,12 @@</span><br><span>      }</span><br><span>    ao2_link_flags(apps_registry, app, OBJ_NOLOCK);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   ao2_unlock(apps_registry);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>         /* We lazily clean up the apps_registry, because it's good enough to</span><br><span>      * prevent memory leaks, and we're lazy.</span><br><span>          */</span><br><span>  cleanup();</span><br><span style="color: hsl(0, 100%, 40%);">-      ao2_unlock(apps_registry);</span><br><span>   return 0;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13675">change 13675</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/c/asterisk/+/13675"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I8f2c0b17e33bb8128441567b97fd4c7bf74a327b </div>
<div style="display:none"> Gerrit-Change-Number: 13675 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>