<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10212">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  George Joseph: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail:  Cleanup mailbox topic and cache<br><br>app_voicemail wasn't properly cleaning up the stasis cache or the<br>mwi topic pool when the module was unloaded or when a user was<br>deleted as a result of a reload.  This resulted in leaks in both<br>areas.<br><br>* app_voicemail now calls ast_delete_mwi_state_full when it frees<br>  a user structure and ast_delete_mwi_state_full in turn now calls<br>  the new stasis_topic_pool_delete_topic function to clear the topic<br>  from the pool.<br><br>Change-Id: Ide23144a4a810e7e0faad5a8e988d15947965df8<br>---<br>M apps/app_voicemail.c<br>M main/app.c<br>2 files changed, 7 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c</span><br><span>index f2b6c97..b371e47 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -2004,6 +2004,10 @@</span><br><span>              return;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ast_strlen_zero(vmu->mailbox)) {</span><br><span style="color: hsl(120, 100%, 40%);">+              ast_delete_mwi_state_full(vmu->mailbox, vmu->context, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  ast_free(vmu->email);</span><br><span>     vmu->email = NULL;</span><br><span>        ast_free(vmu->emailbody);</span><br><span>diff --git a/main/app.c b/main/app.c</span><br><span>index e7aab10..bc28ef6 100644</span><br><span>--- a/main/app.c</span><br><span>+++ b/main/app.c</span><br><span>@@ -3355,6 +3355,9 @@</span><br><span>    if (clear_msg) {</span><br><span>             stasis_publish(mailbox_specific_topic, clear_msg);</span><br><span>   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   stasis_topic_pool_delete_topic(mwi_topic_pool, stasis_topic_name(mailbox_specific_topic));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>         ao2_cleanup(clear_msg);</span><br><span>      return 0;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10212">change 10212</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/10212"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ide23144a4a810e7e0faad5a8e988d15947965df8 </div>
<div style="display:none"> Gerrit-Change-Number: 10212 </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: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>